ios - 如何隐藏 UITableView 中某些单元格的多选编辑 GUI?

标签 ios uitableview uikit interface-builder selection

我正在使用 UITableView,将编辑设置为 true,并在界面构建器中使用这些选项:

enter image description here

这显示了一个不错的选择 UI,我可以修改它的样式和我可以对其使用react的事件:

enter image description here

我想关闭它,但仅限于某些单元格。我看过this和许多类似的问题,但它们指的是 UITableView 中不同类型的选择。 UITableViewCellSelectionStyle.NonewillSelectRowAtIndexPath 不允许我阻止这种类型的选择。

最佳答案

你有没有尝试实现

func tableView(_ tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool

在你的委托(delegate)中?

我相信它会让你获得你想要达到的结果。

关于ios - 如何隐藏 UITableView 中某些单元格的多选编辑 GUI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34699458/

相关文章:

iOS UITextField-取消自定义输入 View

ios - 基于 Swift 3 中的 didSelectRowAtIndexpath 从数组中添加或删除对象

ios - 为什么关闭 View Controller 不会从内存中清除呈现的 Controller ?

javascript - 在 iOS 中加载时防止键盘掉落

ios - 如何让 Prototype TableView 内容显示在标签栏 ViewController 中?

ios - TableViewCell 特定单元格未正确突出显示

ios - 将 UITableViewDataSource 与具有 subview 的自定义单元格一起使用

ios - Swift4,选择单元格时的背景颜色

ios - FIRInstanceID/警告停止!!将从内存中重置 deviceID [Xcode : Console Log]

ios - Uibutton 的 titleLabel.textColor