From 05e0e34f6bc1f923c62bbb68c349dcab5f3244a8 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 5 Nov 2019 15:46:28 -0600 Subject: [PATCH] Configure three panel mode when coming from background. Issue #1251 --- iOS/SceneCoordinator.swift | 5 ++--- iOS/SceneDelegate.swift | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 1ff2dbd90..7826e09cb 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -940,13 +940,12 @@ extension SceneCoordinator: UISplitViewControllerDelegate { } func splitViewController(_ splitViewController: UISplitViewController, separateSecondaryFrom primaryViewController: UIViewController) -> UIViewController? { - if masterNavigationController.viewControllers.count == 3 { - return nil - } else { + if currentArticle == nil { let articleViewController = UIStoryboard.main.instantiateController(ofType: ArticleViewController.self) articleViewController.coordinator = self return articleViewController } + return nil } } diff --git a/iOS/SceneDelegate.swift b/iOS/SceneDelegate.swift index 82cb4e8bb..05df42d02 100644 --- a/iOS/SceneDelegate.swift +++ b/iOS/SceneDelegate.swift @@ -58,6 +58,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { func sceneWillEnterForeground(_ scene: UIScene) { appDelegate.prepareAccountsForForeground() + self.coordinator.configureThreePanelMode(for: window!.frame.size) } func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {