lxcid / LXReorderableCollectionViewFlowLayout

Extends `UICollectionViewFlowLayout` to support reordering of cells. Similar to long press and pan on books in iBook.
http://lxcid.com/
MIT License
1.86k stars 328 forks source link

Limit reordering to within single section #31

Closed svenresch closed 11 years ago

svenresch commented 11 years ago

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

svenresch commented 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.

lxcid commented 11 years ago

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!

svenresch commented 11 years ago

That is perfect! Sorry I had not taken a close enough look at all your additional delegate methods.

Great work!