bvogelzang / BVReorderTableView

Easy Long Press Reordering for UITableView
MIT License
234 stars 59 forks source link

Allow conditional disabling of row re-ordering #13

Closed mluisbrown closed 11 years ago

mluisbrown commented 11 years ago

I needed to be able to conditionally disable re-ordering of certain rows. Since the UITableViewDataSource protocol already has the method tableView:canMoveRowAtIndexPath: I decided that would be the cleanest way to check if a row can be moved or not. The method is only checked if the dataSource implementation implements it.

At the start of the long press gesture, if the dataSource implements tableView:canMoveRowAtIndexPath: and it returns NO then the gesture is cancelled.

bvogelzang commented 11 years ago

Thanks for the pull request. Looks good! Was working on this exact thing the other week but didn't have time to fully test and commit. You beat me to it.