Created
January 18, 2013 22:19
-
-
Save heydona/4569151 to your computer and use it in GitHub Desktop.
Delete confirmation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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