第一次加载网页时脱机失败。然后连接网络调用reload()刷新当前页面,但是不起作用,WKNavigationDelegate不能得到任何回调。
函数reloadFromOrigin()也不起作用
但医生说:
/*! @abstract Reloads the current page.
@result A new navigation representing the reload.
*/
- (nullable WKNavigation *)reload;
/*! @abstract Reloads the current page, performing end-to-end revalidation
using cache-validating conditionals if possible.
@result A new navigation representing the reload.
*/
- (nullable WKNavigation *)reloadFromOrigin;有人能帮助?吗?
发布于 2017-08-16 15:53:20
第一次加载网页时脱机失败。Then webview.url be nil.尝试以下代码:
func reloadButtonDidTap() {
if webview.url != nil {
webview.reload()
} else {
webview.load(URLRequest(url: originalURL))
}
}https://stackoverflow.com/questions/45706866
复制相似问题