在我的应用程序中,我有一个从UIToolbar中的UIBarButtonItem生成的Popover。目前,当显示Popover时,可以点击UIToolbar中的其他按钮。
如果在外面点击Popover,同时也不允许用户点击Popover外面的UIViews,我怎么仍然将其解雇?我只需要禁用Popover外部的视图吗?
// prepare Actions Menu
let storyboard = UIStoryboard(name: "Main", bundle: nil)
actionsVC = storyboard.instantiateViewController(withIdentifier: "actionsViewController") as! ActionsController
actionsVC.modalPresentationStyle = .popover
actionsVC.graph = graph
actionsVC.viewControllerDelegate = self
...
@IBAction func openActionsPopover(_ sender: UIBarButtonItem) {
actionsVC.popoverPresentationController?.barButtonItem = sender
actionsVC.popoverPresentationController?.passthroughViews?.removeAll()
present(actionsVC, animated: true)
}