Reputation: 131
I am using UITableView having edit button to delete a row.when i swipe in the row it shows a default "Delete" button. But I don't need it.The Content of the cell must be deleted by means of edit button not by default one.how to disable that "Swipe to Delete" Button.
Upvotes: 0
Views: 311
Reputation: 7432
Override editingStyleForRowAtIndexPath
:
- (UITableViewCellEditingStyle)tableView:(UITableView*)aTableView
editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.editing)
return UITableViewCellEditingStyleDelete; //or whatever
return UITableViewCellEditingStyleNone;
}
Upvotes: 3