In% w_that implements the% com_view controller associated with the table), you need to implement the selector @interface
. In the implementation you need to change the order of the elements of your UITableViewDataSource (geralmente o
, as in the example below:
- (void) tableView:(UITableView *)tableView
moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath
toIndexPath:(NSIndexPath *)destinationIndexPath
{
NSInteger fromIndex = sourceIndexPath.row;
NSInteger toIndex = destinationIndexPath.row;
if (fromIndex == toIndex) return;
id item = [self.items objectAtIndex:fromIndex];
[self.items removeObjectAtIndex:fromIndex];
[self.items insertObject:item atIndex:toIndex];
}