How to change tableviewcell delete confirmation button prompt line

I just want to change the title of the confirmation button TableViewCellwhen I want to delete one cell, but I did not find any related property in the link. I just want to change the title from delete to trash , does anyone know how?

+4
source share
2 answers
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"trash";
}
+3
source

Overriding existing UITableViewDelegate methods.

Goal - C

-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"Trash";
}

Swift

func tableView(tableView: UITableView, titleForDeleteConfirmationButtonForRowAtIndexPath indexPath:NSIndexPath) -> String
{ 
      return "Trash"; 
}

Hope this help helps you.

+2
source

All Articles