In a WKWebView, every time I tap on a URL, the navigationType
is .other
. When does navigationType
equal .linkActivated
?
Very unlikely. Maybe you are interpreting the raw values wrong?
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
print(navigationAction.navigationType.rawValue)
// -1 "other" seen when assigning the url programatically
// 0 "linkActivated" a link with an href attribute was tapped
// 3 "reload" page was refreshed
}
See the docs where you can click on the enumerations listed and and see their raw values
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With