Webview to show loading indicator for every click inside the webview swift
Solution:
In the ViewController you have to implement the webView delegate methods as like below to achieve the every click action loader in the webView.
In the ViewController you have to implement the webView delegate methods as like below to achieve the every click action loader in the webView.
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
activityindicator.startanimating()
}
func webViewDidFinishLoad(_ webView: UIWebView) {
activityindicator.stopanimating()
}
func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
activityindicator.stopanimating()
}
Comments
Post a Comment