草庐IT

iOS 13.0 UIMenu 和 UIContextMenuConfiguration 的 UIAction

我正在尝试使用iOS13.0Beta中引入的新API。我已经下载了Xcode11.0Beta3以便能够访问这些API。我在网上找到的一些代码执行如下操作:extensionSingleViewController:UIContextMenuInteractionDelegate{funccontextMenuInteraction(_interaction:UIContextMenuInteraction,configurationForMenuAtLocationlocation:CGPoint)->UIContextMenuConfiguration?{letconfigurati

ios - CollectionView 中的 UIMenu 弹出窗口

这就是我设置弹出窗口的方式UIMenuItem*menuItem=[[UIMenuItemalloc]initWithTitle:@"DeletePatient"action:@selector(customAction:)];[[UIMenuControllersharedMenuController]setMenuItems:@[menuItem]];然后添加require方法-(BOOL)canBecomeFirstResponder{returnYES;}-(BOOL)canPerformAction:(SEL)actionwithSender:(id)sender{NSLog