Reputation: 79
I have a UITableView. It pulls information from the address book where needed. I also have the bottom cell programatically made to be a button that loads up the address book.
My problem is when I allow the user to delete a row by swiping right, it shows it for the last cell I have made as a button. Is there a way to not allow a delete function showing on just 1 cell?
Upvotes: 0
Views: 349
Reputation: 53551
Implement tableView:canEditRowAtIndexPath:
in the table view's dataSource
and return NO
for the row you don't want to be deletable.
Upvotes: 2
Reputation: 130082
You have to implement [UITableViewDelegate tableView:editingStyleForRowAtIndexPath:]
and return UITableViewCellEditingStyleDelete
only for the cells that can be deleted. Return UITableViewCellEditingStyleNone
for the cells that can't be deleted.
Upvotes: 0