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,473
  • 6
  • 31
  • 46

2 Answers2

4

You can achieve this by implementing this method

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer {
    return YES;
}
Hiren
  • 12,720
  • 7
  • 52
  • 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,705
  • 6
  • 47
  • 78