Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在导航完成后打印 url,我使用了
webView(_ webView: WKWebView, didFinish navigation: WKNavigation!)
功能,但问题是,对于一些像 harrods.com 这样的网站,它在网站第一次加载时只被调用一次。我需要帮助。对此有任何解决方案吗?
你可以使用这个功能WKNavigationDelegate
WKNavigationDelegate
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy)
并检查导航类型
navigationAction.navigationType