Do not let the cell move to another section

How can I disable so the user can move cells to other sections? I do not want to show a warning every time;)

Thanks: D

+6
iphone uitableview
source share
1 answer

Implement the delegation method targetIndexPathForMoveFromRowAtIndexPath:

- (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath { if (proposedDestinationIndexPath.section != sourceIndexPath.section) { //keep cell where it was... return sourceIndexPath; } //ok to move cell to proposed path... return proposedDestinationIndexPath; } 
+10
source share

All Articles