Freddie
Freddie

Reputation: 47

How to "do not display" the (confirmation) delete button on an UITableView when deleting?

I can not find the anwser over the net, I don't know even it's possible to do this,

Is it possible to do not have the delete button (at your right) in edition mode when you try to delete one item?

enter image description here

Upvotes: 1

Views: 320

Answers (1)

gotnull
gotnull

Reputation: 27224

- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    // Detemine if the user can edit the comment.
    if (something) {
        return UITableViewCellEditingStyleDelete;
    }
    return UITableViewCellEditingStyleNone;
}

Upvotes: 1

Related Questions