就會觸發 checkAction()
解決方案來源:
UIView touch event in controller
myView 指的是
@IBOutlet var myView: UIView
let gesture = UITapGestureRecognizer(target: self, action: #selector(self.checkAction)) self.myView.addGestureRecognizer(gesture) @objc func checkAction(sender : UITapGestureRecognizer) { // Do what you want }
沒有留言:
張貼留言