WkWebView delegates


Gerriet M. Denkmann
 

macOS 13.5

I made a WkWebView and added navigationDelegate and uiDelegate and implemented (almost) all delegate methods, each containing a print().

1. I never see any prints (running in Xcode)
2. the debugger never stops in any delegate function
3. when I implement:

func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void)
{
print(#function + " navigationAction \(navigationAction)")
decisionHandler(.allow)
}

I just see a blank page.
The content loads correctly if I comment this function out.

What am I doing wrong?

Gerriet

Join cocoa@apple-dev.groups.io to automatically receive all group messages.