From e52b3531d90da69b692bef1dd4d670616be2e01c Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 2 Aug 2019 18:14:49 -0500 Subject: [PATCH] Add missing shim controller --- iOS/AppCoordinator.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iOS/AppCoordinator.swift b/iOS/AppCoordinator.swift index 25b19cc1b..fcb96fb44 100644 --- a/iOS/AppCoordinator.swift +++ b/iOS/AppCoordinator.swift @@ -621,11 +621,10 @@ extension AppCoordinator: UISplitViewControllerDelegate { func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool { - if let shimController = rootSplitViewController.viewControllers.last, - let detailNav = shimController.children.first as? UINavigationController, - let detail = detailNav.topViewController as? DetailViewController { - masterNavigationController.pushViewController(detail, animated: false) - return true + if let detailNav = secondaryViewController.children.first as? UINavigationController, let detail = detailNav.topViewController { + masterNavigationController.pushViewController(detail, animated: false) + detail.navigationItem.leftBarButtonItem = rootSplitViewController.displayModeButtonItem + return true } if let subSplit = secondaryViewController.children.first as? UISplitViewController { @@ -967,7 +966,9 @@ private extension AppCoordinator { let systemMessageViewController = UIStoryboard.main.instantiateController(ofType: SystemMessageViewController.self) let navController = addNavControllerIfNecessary(systemMessageViewController, showButton: false) - rootSplitViewController.showDetailViewController(navController, sender: self) + let shimController = UIViewController() + shimController.addChildAndPinView(navController) + rootSplitViewController.showDetailViewController(shimController, sender: self) return navController } else {