设置哪一组哪一行可滑动
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool{
if indexPath.section==1 {
if indexPath.row != 0 {
return true
}else{
return false
}
}else{
return false
}
}
func tableView(_ tableView: UITableView, titleForDeleteConfirmationButtonForRowAt indexPath: IndexPath) -> String?{
return "删除"
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath)
{
if editingStyle == UITableViewCellEditingStyle.delete {
self.diagnoseArr.removeObject(at: indexPath.row-1)
//刷新tableview
tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.automatic)
}
}