Re: WKWebView


Gerriet M. Denkmann
 

On 5 Oct 2017, at 18:38, Alex Zavatone <zav@...> wrote:

WKPrivateNavigationDelegate webView:decidePolicyForNavigationAction?

On Oct 5, 2017, at 6:32 AM, Gerriet M. Denkmann <g@...> wrote:

The documentation says:
“In apps that run in macOS 10 and later, use the WKWebView class instead of using WebView.”
“In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView.”

WebView has:
webView:decidePolicyForNavigationAction:decisionHandler:

and UIWebView has:
webView:shouldStartLoadWithRequest:navigationType:

what would the equivalent in WKWebView be?

WKNavigationDelegate has:
webView:decidePolicyForNavigationAction:decisionHandler:
Correction:
this is only called once (after loadHTMLString:baseURL:) with navigationType = WKNavigationTypeOther;
and also when clicking on a link with scheme ≠ file with navigationType = WKNavigationTypeLinkActivated.

By the way, this is still macOS 12 (because the installer for macOS 13 does not work).

Gerriet.

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