Anthony
Anthony

Reputation: 2801

How do you enable UITableViewCell reorder without removing control with "setEditing " method?

When I use [tableview setEditing:YES animated:YES]; to enable UITableViewCell reorder, the remove control appears too. How can I prevent that ?

Upvotes: 4

Views: 2319

Answers (2)

Tomasz Wojtkowiak
Tomasz Wojtkowiak

Reputation: 4920

Add this method to youc code:

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return NO;
}

Upvotes: 0

kennytm
kennytm

Reputation: 523304

Implement -tableView:editingStyleForRowAtIndexPath: in the table view delegate and return UITableViewCellEditingStyleNone.

Upvotes: 15

Related Questions