Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the text of delete button in a UITableCell on swap event

i have implemented the functionality to make delete button visible on swap and it also delets the cell by clicking on the button. but i just want to change the text of delete button from "DELETE" to "CANCEL"

like image 350
Syed_Adeel Avatar asked May 19 '11 07:05

Syed_Adeel


2 Answers

Implement the following in your UITableViewDelegate:

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"Cancel";
}
like image 66
rckoenes Avatar answered Oct 15 '22 13:10

rckoenes


You can use the UITableViewDelegate protocol method:

tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:

like image 43
Nick Weaver Avatar answered Oct 15 '22 14:10

Nick Weaver