DraggableCollectionView icon indicating copy to clipboard operation
DraggableCollectionView copied to clipboard

The cell is being dragged should be set to "selected" status if possible.

Open simplelife-patrick opened this issue 11 years ago • 0 comments

I have a collection view which can drag and drop cells based on this library, and my cell can be single-selected(like cell border's color change). If I have selected cell A, and then long press cell B to trigger dragging, the selected status can not move from cell A to cell B. In order to resolve this issue, I put some codes like below into LSCollectionViewHelper.m - (void)handleLongPressGesture:(UILongPressGestureRecognizer *)sender:

        NSArray* selectedIndexPathes = self.collectionView.indexPathsForSelectedItems;
        for (NSIndexPath* p in selectedIndexPathes)
        {
            [self.collectionView deselectItemAtIndexPath:p animated:NO];
        }
        [self.collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone];

simplelife-patrick avatar Nov 28 '13 06:11 simplelife-patrick