Limiting UITableview Cell Moves Between Sections

Problem: You want to limit if a tableview cell is ABLE to move to a new section, or is limited to ONLY moving to a new section. For example in mySlate I’m supporting moving bookmarks to a new section/folder. However the bookmarks are laid out in alphabetical order inside a section/folder, so re-ordering them would do no good. Each time you open the bookmarks view they are returned alphabetically from the data store.
Solution:
- (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath
{
if( sourceIndexPath.section != proposedDestinationIndexPath.section )
{
return proposedDestinationIndexPath;
}
else
{
return sourceIndexPath;
}
//Reverse those to support only moving inside a section
}
Of course supporting movement in the tableview is yours to implement.
Source: stackoverflow


