Reputation: 50816
I have three sections in my hypothetical UITableView. I'd like one section that is in editing mode. The rest of the sections to not be in editing mode. Is this possible at all?
Upvotes: 9
Views: 4498
Reputation: 63
This worked great for me. In the example below section 0 is not editable whilst the other sections are.
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
if indexPath.section == 0{
return false
}
return true
}
Upvotes: 0
Reputation: 12187
This really shouldn't be a mystery, as it's spelled out clearly in the documentation. Simply use the datasource method
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
Upvotes: 25