2

How to know did WebView had already load url inside ?

My way (using delegate) :

var loadStates=false
func loadPage()
{
    if loadStates==false
    {
        let url = NSURL (string: "https://www.google.com/");
        let requestObj = NSURLRequest(URL: url!);
        webView.loadRequest(requestObj);

    }
}
func webViewDidFinishLoad(webView: UIWebView)
{
    hideActivityIndicator(webView)
    loadStates=true
}

Have some better way to do this ? like wevView.isEmpty()==true syntax in Swift way?

Vic
  • 758
  • 2
  • 15
  • 31

0 Answers0