Fix content offset bug in detail view

This commit is contained in:
Maurice Parker 2019-09-21 12:43:15 -05:00
parent b49aeca577
commit 4e7ef7271a
1 changed files with 10 additions and 3 deletions

View File

@ -48,11 +48,13 @@ class DetailViewController: UIViewController {
DetailViewControllerWebViewProvider.shared.dequeueWebView() { webView in
self.webView = webView
self.webViewContainer.addChildAndPin(webView)
webView.navigationDelegate = self
self.webViewContainer.addChildAndPin(webView)
self.updateArticleSelection()
// Even though page.html should be loaded into this webview, we have to do it again
// to work around this bug: http://www.openradar.me/22855188
webView.loadHTMLString(ArticleRenderer.page.html, baseURL: ArticleRenderer.page.baseURL)
}
}
@ -237,6 +239,11 @@ extension DetailViewController: WKNavigationDelegate {
}
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.updateArticleSelection()
}
}
// MARK: Private