I need to add the "swipe to delete" feature on my UITableView, I tried with the following code:
- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView
editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleDelete;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[indexProdotti removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else {
NSLog(@"Unhandled editing style! %ld", (long)editingStyle);
}
}
The problem is that there is only a limited space I have to swipe in order to show the delete button, the rest of the cell if swiped gives no result.. Am I missing something in my implementation?