我定义了一个连接到UIAlertcontroller视图的长手势控制器,当我点击Ok按钮时,该视图会运行。当验证为false时,警报不会在ios 9.3中被解除,但在ios 10中被取消。我想弄清楚为什么不在ios 10中工作
设置手势
let gestureRecognizer = UILongPressGestureRecognizer.init()
gestureRecognizer.minimumPressDuration = 0.0
gestureRecognizer.delegate = self
gestureRecognizer.addTarget(self, action: #selector(self.appendAlert(sender:)))
alert.view.addGestureRecognizer(gestureRecognizer)
手势目标函数定义
func appendAlert(sender: UILongPressGestureRecognizer)