lukescott / DraggableCollectionView

Extension for the UICollectionView and UICollectionViewLayout that allows a user to move items with drag and drop. --- HELP WANTED --- Looking for maintainer and help with the experimental branch.
MIT License
549 stars 175 forks source link

Mock cell generated in long press event can not support custom UICollectionView class. #24

Open simplelife-patrick opened 11 years ago

simplelife-patrick commented 11 years ago

Below codes part is form the hanleLongPressGesture: methods in LSCollectionViewHelper.m file:

        // Create mock cell to drag around
        UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
        cell.highlighted = NO;
        [mockCell removeFromSuperview];
        mockCell = [[UIImageView alloc] initWithFrame:cell.frame];
        mockCell.image = [self imageFromCell:cell];
        mockCenter = mockCell.center;
        [self.collectionView addSubview:mockCell];
        [UIView
         animateWithDuration:0.3
         animations:^{
             mockCell.transform = CGAffineTransformMakeScale(1.1f, 1.1f);
         }
         completion:nil];

If I use a custom UICollectionView class, how can I make the same effect in demo app(like UICollectionViewCell object turns dark once be long pressed, and turns bigger(110%) than original size during the drag operation? (By testing custom cell can't have the same effect)

Thanks.