Answer the question
In order to leave comments, you need to log in
How to detect click on image in UIWebView in iOS?
It is necessary to execute a certain method on clicking on the image
Answer the question
In order to leave comments, you need to log in
You can execute your JS code in the context of the UIWebView page https://developer.apple.com/library/ios/documentat...
In this JS code, for example, hang handlers on the onclick event on all pages and pass them to this handler the element itself or, for example, a link to the image itself. In the event handler, you can redirect to some url like mypotocol://myurl.
And now, in the webView:shouldStartLoadWithRequest:navigationType: delegate method, define the protocol and url, and if it matches mypotocol and / or myurl, then perform the necessary actions, while returning NO.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question