I have this code implemented in my tableView:
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return NO;
}
return YES;
}
It does what I want, but I want to go one step better and make "section 0" disappear altogether when the edit button is pressed (this effect can be seen if you go into the "keyboard" menu on iOS and select edit in the top right corner, the top two sections disappear in an animation). I have attempted to temporarily remove the first section, but my app crashes when [tableView reloadData];
is called:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
if (tvController.editing == YES) {
return 1;
}else if (tvController.editing == NO) {
return 2;
}
return 0;
}
Also, I do not think I will end up with an animation if I get that code working, I think my approach is wrong. Thanks for your help guys!