Skip to content

Instantly share code, notes, and snippets.

@heydona
Created January 18, 2013 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heydona/4569151 to your computer and use it in GitHub Desktop.
Save heydona/4569151 to your computer and use it in GitHub Desktop.
Delete confirmation
- (void)delete:(id)sender {
_isDeleting = YES;
[self commitEdit:UITableViewCellEditingStyleDelete];
}
- (void)commitEdit:(UITableViewCellEditingStyle)editStyle {
[self willTransitionToState:UITableViewCellStateShowingEditControlMask];
if ([[_table dataSource] respondsToSelector:@selector(tableView:commitEditingStyle:forRowAtIndexPath:)]) {
NSIndexPath *ip = [_table indexPathForRowAtPoint:[self center]];
[[_table dataSource] tableView:_table commitEditingStyle:editStyle forRowAtIndexPath:ip];
}
[self didTransitionToState:UITableViewCellStateShowingEditControlMask];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment