Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

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

Open
simplelife-patrick opened this issue Nov 28, 2013 · 0 comments

Comments

@simplelife-patrick
Copy link

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];
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant