//某行是否支持编辑状态
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
    return YES;

}

//某行的编辑状态是哪一种

-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{

    return UITableViewCellEditingStyleDelete;
}

//删除状态的文字是什么
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
    return @"删除此行";

}
//当编辑操作被触发后做什么
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{

  //删除操作非常危险,所以加个弹窗,通知一下比较好。以下引入了第三方框架blockskit可少写一个方法。
    [[UIAlertView bk_showAlertViewWithTitle:[self.kindVM titleForRow:indexPath.row] message:@"确认要删除吗?删除将无法恢复" cancelButtonTitle:@"放弃" otherButtonTitles:@[@"确认"] handler:^(UIAlertView *alertView, NSInteger buttonIndex) {
        if (buttonIndex == 1) {//当按钮值为1时就执行删除
            if (editingStyle == UITableViewCellEditingStyleDelete) {

               //在你的数据模型中加入删除方法。如下方方法removeKindForRow。返回值为BOOL类型
                if ([self.kindVM removeKindForRow:indexPath.row]) {

             //当判断为YES时,说明模型中的数据删掉了。然后删除当前页面对应行。
                    [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
                }
            }
        }
    }] show];//最后不要忘记让你的弹窗显示出来。
}