add stop loading, although it not loading

This commit is contained in:
Xinlei(Ryan) Pan 2020-04-01 19:32:36 -04:00
parent 95d305254f
commit 4abfeef11a

View File

@ -69,6 +69,7 @@ import WebKit
if let previousUrl = previousURL, url == previousUrl {
//dont load the new
} else {
webView?.stopLoading()
webView?.load(URLRequest(url: url))
webViewHeight?.constant = 44
overLayer.isHidden = false
@ -78,6 +79,7 @@ import WebKit
if let previousHTML = previousHtmlString, previousHTML == htmlString {
//dont load the new html since they are the same html string as preivous
} else {
webView?.stopLoading()
webViewHeight?.constant = 44
webView?.loadHTMLString(htmlString, baseURL: nil)
overLayer.isHidden = false