关于TableView自带左滑功能8.x 9.x的区别

系统自带左滑功能在9.x的系统中只需要在下面方法中添加

- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath{

    UITableViewRowAction *delAct = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {

    }];
    return @[delAct];
}

而在8.x的系统中仅仅是重写这一个方法是不够的,还需要重写下面方法,不需要在其中写内容

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
    
}

你可能感兴趣的:(关于TableView自带左滑功能8.x 9.x的区别)