iOS WKWebview how to detect when I click on an image inside of <a> tag
<p>I'm trying to change my <code>UIWebView</code> to <code>WKWebView</code> in my app (<code>Objective-C</code>).
I see <code>WKWebView</code> contain tag "a" and inside of tag "a" contain tag "image":</p>

<pre><code>&lt;a href="http://click.adzcore.com/xyz"&gt;&lt;img src="http://www.abc.xyz/smart/images/bnr/yyy.png" width="320" height="50" border="0" alt="+alt[n]+" onclick="_gaq.push(['_trackPageview','/smart/count/frognote']);"&gt;&lt;/a&gt;
</code></pre>

<p>I want detect when user click on image, so I do:</p>

<pre><code>- (void)webView:(WKWebView )webView decidePolicyForNavigationAction:(WKNavigationAction )navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {

    if (navigationAction.navigationType == WKNavigationTypeLinkActivated) {
        NSURL *url = navigationAction.request.URL;
        [[UIApplication sharedApplication] openURL:url];
        decisionHandler(WKNavigationActionPolicyCancel);
        return;
    }
    decisionHandler(WKNavigationActionPolicyAllow);
}
</code></pre>

<p>But this code is not correct because <code>WKNavigationTypeLinkActivated</code> is not catched when user click on image.</p>