Rafay Hasan Rafay Hasan - 2 months ago 12x
iOS Question

Delete a tableview cell by tapping the red minus icon in iOS

I want to delete the tableview cell right away without the confirmation of red "Delete" button press when user clicks the red minus icon.
Steps 1. Hit edit button > red minus icon appears > hit the minus icon >> row deleted without showing the red "Delete" icon.


This does the work you want.

- (nullable NSString *)tableView:(UITableView *)tableViews titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath 
[arrOutputRecords removeObjectAtIndex:indexPath.row];

[tableViews deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]

[_tableView reloadData];

return @"";