WKWebView does not call delegate when user click a link

I updated my Mac OS application with WKWebView but I found that when I click on a link the delegate (- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler) is not called.

The same application under iOS and Mac catalyst works fine.

Is someone able to get me an explanation and a solution?

Thank you very much in advance,
Giordano

Replies

Please file a Feedback Assistant (Radar) with your sample Xcode project (reduced test case) that reproduces the issue, and post the ID created here.

Sometimes in the process of creating a reduced test case for your bug, you may find the cause of the issue. For example, maybe the delegate method isn't compiled on macOS because there is an #ifdef that prevents it from being compiled. An easy way to check that is to put an "#error" statement inside the delegate method and compile the app for macOS.