I need to know, when a web page has completely been loaded by UIWebView. I mean, really completely, when all redirects are done and dynamically loaded content is ready. I tr
Since all these answers are old and webViewDidFinishLoad has been depreciated and many headaches later let me explain how to exactly know when a page has finished loading in a webkit (webview) with swift 4.2
class ViewController: UIViewController, WKNavigationDelegate {
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
override func viewDidLoad() {
webView.navigationDelegate = self
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
// it is done loading, do something!
}
}
Of course I am missing some of the other default code so you are adding to your existing functions.