Skip to content

Instantly share code, notes, and snippets.

@joaofranca
Created July 22, 2012 13:02
Show Gist options
  • Save joaofranca/3159585 to your computer and use it in GitHub Desktop.
Save joaofranca/3159585 to your computer and use it in GitHub Desktop.
gist 4: iOS - Customize UITableViewCell delete/move overlay views while editing
// update datasource after moving
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
// you should correct the data source order here to reflect the row moving
// it should be somethig like:
NSString * tmp = [sourceArray objectAtIndex:fromIndexPath.row];
[sourceArray removeObjectAtIndex:fromIndexPath.row];
[sourceArray insertObject:tmp atIndex:toIndexPath.row];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment