// UIGestureRecognizerDelegate を指定
class MyViewController: UIViewController, UIGestureRecognizerDelegate
override func viewDidLoad() {
super.viewDidLoad()
let tapGesture = UITapGestureRecognizer(target: self, action: "didTapWebView:")
tapGesture.numberOfTapsRequired = 1
tapGesture.delegate = self
self.webView.addGestureRecognizer(tapGesture)
}
func gestureRecognizer(
gestureRecognizer: UIGestureRecognizer,
shouldRecognizeSimultaneouslyWithGestureRecognizer
otherGestureRecognizer: UIGestureRecognizer
) -> Bool {
return true
}
func didTapWebView(recognizer: UITapGestureRecognizer) {
println("didTapWebView")
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme