From 4ab45f09bf412bcaa5fd82b2888084e19a398a55 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 10 Oct 2023 20:39:08 -0500 Subject: [PATCH] Remove old view before adding a new webview when doing a full reload. Fixes #3988. --- iOS/Article/WebViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index df4b46549..da3da8ed5 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -557,6 +557,7 @@ private extension WebViewController { // Add the webview - using autolayout will cause fullscreen video to fail and lose the web view webView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + self.webView?.removeFromSuperview() self.view.insertSubview(webView, at: 0) // UISplitViewController reports the wrong size to WKWebView which can cause horizontal