0

I'm trying to add UITapGestureRecognizer to my view with big UIWebView, but in works only if user tap not in UIWebView. How can I fix this? Thank you.

Tunyk Pavel
  • 2,433
  • 6
  • 30
  • 44

2 Answers2

4

You can achieve this by implementing this method

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer {
    return YES;
}
Hiren
  • 12,632
  • 7
  • 53
  • 72
abc
  • 41
  • 2
0

UIWebView has it's own tap handling for opening links etc., therefor it doesn't handle "your" touches. You should subclass WebView and override tap handling. Good example here.

Kai Huppmann
  • 10,623
  • 5
  • 45
  • 76