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
Crashes on longPress with more than one section #41
This has been wonderfully useful, but when I added a second section, it crashes on a longPress in: - (NSIndexPath *)indexPathForItemClosestToPoint:(CGPoint)point
I suspect that I am missing something really basic in my implementation. A FlowLayoutDemo with sections would probably clear up my error.
After longPressing in section 1, item 2:
items = 3,
nextIndexPath = 1,3 .
Perhaps the problem is because of zero based counting, the last valid indexPath is 1,2.
This has been wonderfully useful, but when I added a second section, it crashes on a longPress in: - (NSIndexPath *)indexPathForItemClosestToPoint:(CGPoint)point
I suspect that I am missing something really basic in my implementation. A FlowLayoutDemo with sections would probably clear up my error.
Relevant Code in indexPathForItemClossestToPoint:
CRASHES HERE-->>>>>> layoutAttr = [self.collectionView.collectionViewLayout layoutAttributesForItemAtIndexPath:nextIndexPath];
There are no are error messages in the debugger.
After longPressing in section 1, item 2: items = 3, nextIndexPath = 1,3 . Perhaps the problem is because of zero based counting, the last valid indexPath is 1,2.
I would greatly appreciate some help here.
Thanks