3

When I call [self.tableView setEditing:YES animated:YES], the tableview goes into editing mode. When I press on the round minus button, the delete button appears. I would like to change the title of this delete button. How can I do that?

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
Zia
  • 14,622
  • 7
  • 40
  • 59
  • you just want to change title for delete button? or completely delete button? – Fahim Parkar Mar 21 '14 at 20:28
  • 1
    @FahimParkar The question clearly states that they want to change the title. – rmaddy Mar 21 '14 at 20:29
  • @rmaddy : I understand, but usually all ask for button design as the one apple have is ugly... – Fahim Parkar Mar 21 '14 at 20:31
  • 1
    if you want design to be changed of delete button, follow link http://stackoverflow.com/questions/1615469/custom-delete-button-on-editing-in-uitableview-cell, [google result](https://www.google.com.kw/search?q=uitableview+custom+delete+button&rlz=1C5CHFA_enKW503KW503&oq=uitableview+custom+delete+button&aqs=chrome..69i57j69i60l4j69i65.4395j0j7&sourceid=chrome&espv=210&es_sm=91&ie=UTF-8) – Fahim Parkar Mar 21 '14 at 20:31

1 Answers1

12

This is easily done using the proper UITableViewDelegate method:

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"CustomLabel";
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579