I am using the following code to show a delete button when the user swipes the tableview
cell. I want to write Cancel instead of Delete in this button, how can i achieve this functionality??
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
And
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
//remove the deleted object from your data source.
//If you're data source is an NSMutableArray, do this
[self.dataArray removeObjectAtIndex:indexPath.row];
}
}