From 7e820c58e5ba518d09b2439490cca07752902cda Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 4 May 2021 21:44:55 -0500 Subject: [PATCH] Reload the webview when rotating the device on an iPhone. Fixes #3041 --- iOS/Article/WebViewController.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 968a00ea6..8e47f8abd 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -79,6 +79,13 @@ class WebViewController: UIViewController { } + override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + // We need to reload the webview on the iPhone when rotation happens to clear out any old bad viewport sizes + if traitCollection.userInterfaceIdiom == .phone { + loadWebView() + } + } + // MARK: Notifications @objc func webFeedIconDidBecomeAvailable(_ note: Notification) {