Make sure we have only one web view in the view hierarchy after navigation. Issue #2075
This commit is contained in:
parent
8500324eb2
commit
8ff2776d88
|
@ -60,7 +60,7 @@ class WebViewController: UIViewController {
|
||||||
|
|
||||||
private(set) var article: Article?
|
private(set) var article: Article?
|
||||||
|
|
||||||
let scrollPositionQueue = CoalescingQueue(name: "Article Scroll Position", interval: 0.3, maxInterval: 1.0)
|
let scrollPositionQueue = CoalescingQueue(name: "Article Scroll Position", interval: 0.3, maxInterval: 0.3)
|
||||||
var windowScrollY = 0
|
var windowScrollY = 0
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
|
@ -291,7 +291,7 @@ extension WebViewController: UIContextMenuInteractionDelegate {
|
||||||
extension WebViewController: WKNavigationDelegate {
|
extension WebViewController: WKNavigationDelegate {
|
||||||
|
|
||||||
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
||||||
if view.subviews.count > 1 {
|
while view.subviews.count > 1 {
|
||||||
view.subviews.last?.removeFromSuperview()
|
view.subviews.last?.removeFromSuperview()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue