我在我的 tableview 上使用了 contextMenuConfigurationForRowAt,但我想根据数据启用/禁用它
是否有可能对所有单元格都执行?
谢谢
答案 0 :(得分:1)
检查Docs
<块引用>使用此方法提供描述要呈现的菜单的 UIContextMenuConfiguration。返回 nil 以防止交互开始。
func tableView(_ tableView: UITableView,
contextMenuConfigurationForRowAt indexPath: IndexPath,
point: CGPoint) -> UIContextMenuConfiguration? {
return arr[indexPath.row].showMenu ? menu : nil
}