How to forbid the movement between 2 UITableViewCells in different section in same UITableView
I have a UITableView with 2 sections. The UITableCells in the same section can be mov开发者_StackOverflow中文版ed. But I hope to forbid the movement between 2 UITableViewCells in different sections of a same UITableView. Is it possible?
Welcome any commnet
Thanks
interdev
In the tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:
if (proposedDestinationIndexPath.section == sourceIndexPath.section)
return sourceIndexPath;
This will cause the row to go back to it's source indexpath if the section that it's trying to move to, isn't the same section as it's original indexpath
精彩评论