Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
- [tableView beginUpdates];
- if (editingStyle == UITableViewCellEditingStyleDelete) {
- // Do whatever data deletion you need to do...
- // Delete the row from the data source
- [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:YES];
- }
- [tableView endUpdates];
- }
- // If I want to delete the next 3 cells after the one you click
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- NSMutableArray* indexPaths = [NSMutableArray array];
- for (int i = indexPath.row + 3; i < indexPath.row + 3; i++)
- {
- [indexPaths addObject:[NSIndexPath indexPathForRow:i inSection:0]];
- }
- [tableView beginUpdates];
- [tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade];
- [tableView endUpdates];
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
- }
Add Comment
Please, Sign In to add comment