Open TheCoordinator opened 11 years ago
I also have this problem
Try this:
- (BOOL)collectionView:(UICollectionView *)collectionView canMoveItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row >= [self.items[indexPath.section] count]) {
return NO;
}
return YES;
}
Thanks wiruzx, that solved the problem. It also prevents from selecting a nearby cell if touching empty space which is (usually) the desirable behaviour.
@wiruzx Thanks wiruzx, It was a tremendous help.
If the long press is not happening on the cell but on the empty space of the UICollectionView, it causes an NSRangeException.
You can reproduce the bug from the FlowLayoutDemo app.