Newbie Question.
I have a UIWebView that I push HTML code into. In the HTML code is an image. Is there a way to get informed that image #3 or image with name ‘bob’ was touched ? Some event like ‘didImageWasClickedAndHereIsTheIDOfTheClickedThingy’ perhaps?
I don’t think there is a good way to do this that is directly supported by
UIWebView, but there is a slightly hacky way.Add JavaScript
onclickhandlers to your images that do something like this:When the user taps the image, a request will me made, which can be intercepted by your app by implementing
webView:shouldStartLoadWithRequest:navigationType:on theUIWebView‘s delegate.