6

I have a Webview (inside a view) and a toolbar which is hidden most of the time.

This is quite common behaviour for ipad magazines: Tapping on the page will hide and display the toolbar, but the toolbar is hidden by default.

I am using shouldRecognizeSimultaneouslyWithGestureRecognizer

The behaviour right now does this:
- If the user taps the page (webview) it toggles the toolbar state using gesture recognizer
- if the user taps the page and there is an interactive element such as a weblink within the UIWebview, it responds to that interactive link but ALSO toggles the toolbar.

The desired behaviour is this:
- if the user taps the page on a non interactive area, it toggles the toolbar state
- if the user taps the page on an interactive area it ONLY responds to the webview interaction and does NOT toggle the toolbar.

Note there is an almost identical question here: Gesture recognition with UIWebView
Even though it is marked as resolved if you read it through you will see the solution did not work for the poster and he is still getting a dual response when he (and I) want an either or response. I did try posting a follow up question but that was deleted probably because the moderator believed it was resolved

Community
  • 1
  • 1
tester1
  • 61
  • 1

1 Answers1

0

If the UIWebView, for whatever reason, catches the touch, you're not going to be able to get the UIGestureRecognizer callback as well. My only recomendation is to make whatever happens in the website when you tap on something execute some javascript, and then catch that Javascript. You can take this as an example.

Community
  • 1
  • 1
Javier Soto
  • 4,840
  • 4
  • 26
  • 46