【发布时间】:2017-01-26 11:49:39
【问题描述】:
我试图让它在一个完成加载后加载 2 个 webview 然后它会转到下一个并开始加载那个,如果它们都加载了,它将发送通知。
在
之后会报错 @IBAction func MybuttonAction(_ sender: Any) {
if !googleLoaded {
googleLoaded = true
let url = URL(string: "https://google.com")
let requestObj = URLRequest(url: url!)
webView.loadRequest(requestObj)
print("Google loaded")
let url1 = URL(string: "https://yahoo.com")
let requestObj1 = URLRequest(url: url1!)
webView.loadRequest(requestObj1)
print("yahoo loaded")
} else if !yahooLoaded {
yahooLoaded = true
let alertController = UIAlertController(title: "ThankYou", message: "Both Views have finished loading", preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
self.aviLoadingSpinner.stopAnimating()
}
}
func webViewDidFinishLoad(_ webView: UIWebView) {
}
【问题讨论】:
标签: swift webview uiwebview uiwebviewdelegate