我的 UITableView 中的一些行需要在编辑模式下删除和移动,但有些行只是移动。 在这种方法中,我可以启用或禁用对某些行的编辑
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool{
return true
}
但是如何在启用移动的情况下禁用某些行的删除?
最佳答案
为 editingStyleForRowAtIndexPath
返回 .None
:
func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {
return .None
}
显示如何删除缩进的更完整答案在此处 -> Is there any way to hide "-" (Delete) button while editing UITableView
关于ios - 如何启用移动但禁用删除 UITableView 中的某些行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29001216/