Reputation: 3001
After the classic swipe to delete, there are two possibilities,
- The user has pressed the "Delete" Button, so this function is fired:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
- The user has pressed outside the button, so the edit state is cancelled.
Does anyone knows which function (if it exists) is fired when the editing is cancelled, or how can I catch this event? so I can do some stuff right after the deletion is cancelled.
Thanks.
Upvotes: 3
Views: 361
Reputation: 89509
When the edit state is finished, you'll know via the UITableViewDelegate method - (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
You just need to figure out how to differentiate between a delete and a cancel. You'll know it's a delete if the data source "tableView:commitEditingStyle:forRowAtIndexPath:
" method is called. If it isn't, then the user cancelled.
Upvotes: 3