Hi there I am trying to change the text that is showing in the delete button when a user swipes a uitableviewcell inside my tableview.
I have seen an example in another question thread that says to use this tableview delegate
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
My question is, how do I use this method.. I am not sure how to use this.
Just return the string that you want to display instead of delete. Say you wish to show "Erase" for all rows, the above function should contain:
Read THIS
Also in your .h file, add the UITableViewDelegate in case your view controller is not a UITableViewController already. That is it can be either:
OR
In your controller managing the
UITableView
you should implement theUITableviewDelegate
and return the title you want for your method inside thetitleForDeleteConfirmationButtonForRowAtIndexPath
method.Example:
Leaving you off with something like that:
In Swift it is equal, just method signature is diferent!