【发布时间】:2018-10-10 14:58:45
【问题描述】:
我想更新 tableview 菜单项控制器中的菜单项,因为现在我只得到这些
我已经实现了这个:
func tableView(_ tableView: UITableView, shouldShowMenuForRowAt indexPath: IndexPath) -> Bool {
let forword = UIMenuItem(title: "Demo", action: #selector(self.demo))
UIMenuController.shared.menuItems?.append(forword)
UIMenuController.shared.update()
return true
}
func tableView(_ tableView: UITableView, performAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) {
UIMenuController.shared.setMenuVisible(true, animated: true)
}
func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) -> Bool {
return true
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.clearAllSelectedCell()
}
但我的要求是这样做:
我怎样才能做到这一点?
【问题讨论】:
-
是的,我有,但我希望这两个选项更多地出现在菜单控制器中
-
除了标准项之外,您还想转发和删除,还是代替?
-
是的,我还想要
标签: ios iphone swift tableview menuitem