Closed svenresch closed 11 years ago
Figured out how to make things work... Just added a check to see if index sections match and return right away from invalidateLayoutIfNecessary when not matching.
(void)invalidateLayoutIfNecessary { NSIndexPath newIndexPath = [self.collectionView indexPathForItemAtPoint:self.currentView.center]; NSIndexPath previousIndexPath = self.selectedItemIndexPath;
if ((newIndexPath == nil) || [newIndexPath isEqual:previousIndexPath]) { return; }
// allow reordering items only within single sections. if ( newIndexPath.section != previousIndexPath.section ) { return; } ....
Hi @Logicopolis,
Thanks for using the library. I'm glad you find it useful.
As for your need, you could implements the delegate method itemAtIndexPath: canMoveToIndexPath:
and return turn only if the index path section are the same. :)
Cheers!
That is perfect! Sorry I had not taken a close enough look at all your additional delegate methods.
Great work!
I just found your project and it looks like it will potentially be a great fit for a new app that I'm working on!
I've just started to look at your code and was wondering what you think here. I'd like to limit reordering of items to be only in the same section as they are originally found with. Do you have any recommendations on how to achieve this?
Thanks much, S