From 4075da2ee804c7b2f9d4c85831047de2978e09f4 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 16 Jun 2020 08:07:54 -0500 Subject: [PATCH 1/2] Fix removal of tap zones when removing old web views --- iOS/Article/WebViewController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 5598abfec..d702b0b87 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -300,8 +300,10 @@ extension WebViewController: UIContextMenuInteractionDelegate { extension WebViewController: WKNavigationDelegate { func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { - while view.subviews.count > 1 { - view.subviews.last?.removeFromSuperview() + for (index, view) in view.subviews.enumerated() { + if index != 0, let oldWebView = view as? PreloadedWebView { + oldWebView.removeFromSuperview() + } } } From 7dd20560c326753113edd8e9e1c1958466d584ff Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 16 Jun 2020 08:09:28 -0500 Subject: [PATCH 2/2] Remove reset of web view controller when returning to foreground. --- iOS/Article/ArticleViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index b43783b64..fe5fe3af3 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -210,7 +210,6 @@ class ArticleViewController: UIViewController { if AppDefaults.articleFullscreenEnabled { currentWebViewController?.hideBars() } - resetWebViewController() } // MARK: Actions