Renaming the Delete button in tableviewcontroller edit mode

Is it possible to rename the "Delete" button when in tabular mode drag a table view to edit mode?

+8
iphone cocoa-touch uitableview
source share
4 answers

The UITableView delegate should implement:

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath 
+15
source share

Run

 - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath 

And return your own header for deletion.

From UITableViewDelegate docs

+5
source share

In Swift:

 override func tableView(tableView: UITableView, titleForDeleteConfirmationButtonForRowAtIndexPath indexPath: NSIndexPath) -> String? { return "Remove" } 
+1
source share

the code:

 *- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { return @"Rename"; // or put something else }* 
0
source share

All Articles