iOS tableView自定义删除按钮

// 自定义左滑显示编辑按钮

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

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

        NSLog(@"删除");

    }];

    rowAction.backgroundColor = [UIColor yellowColor];

    NSArray *arr = @[rowAction];

    return arr;

}
相关文章
相关标签/搜索