Reputation: 12325
So with regards to the rightBarButtonItem . I have
self.navigationItem.rightBarButtonItem = self.editButtonItem;
When I press Edit, I get animation and a vertical stripe on the left side of each TableViewCell. When I click that stripe, the Delete button appears on the right side of THAT tableViewCell.
I want to do two things.
I would appreciate any help on that..
:)
Upvotes: 0
Views: 988
Reputation: 12325
For the second part of the answer I did this.
if (editingStyle == UITableViewCellEditingStyleDelete) {
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
if (selectedCell.accessoryType == UITableViewCellAccessoryNone)
{
selectedCell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else
if (selectedCell.accessoryType == UITableViewCellAccessoryCheckmark)
{
selectedCell.accessoryType = UITableViewCellAccessoryNone;
}
}
and
- (NSString *) tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
if (selectedCell.accessoryType == UITableViewCellAccessoryNone)
{
return (@"Check");
}
else
if (selectedCell.accessoryType == UITableViewCellAccessoryCheckmark)
{
return (@"UnCheck");
}
}
Upvotes: 1
Reputation: 21882
Implement tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:
in your table view delegate.
Upvotes: 3