Detect when WKWebView is finished loading

后端 未结 1 1644
孤独总比滥情好
孤独总比滥情好 2021-02-20 15:41

How can I detect when my WKWebView is finished loading so that I can fetch the URL from it such as using the delegate method?

I implemented the delegate met

相关标签:
1条回答
  • 2021-02-20 16:26

    SWIFT 4:

    Use following delegate method of WKNavigationDelegate. Where you can check is finished loading ?? And here you can get URL loaded in webView.

    func webView(_ webView: WKWebView, didFinish  navigation: WKNavigation!) 
    {
        let url = webView.url?.absoluteString
        print("---Hitted URL--->\(url!)") // here you are getting URL
    }
    
    0 讨论(0)
提交回复
热议问题