Add missing shim controller

This commit is contained in:
Maurice Parker 2019-08-02 18:14:49 -05:00
parent 7acf77f572
commit e52b3531d9
1 changed files with 7 additions and 6 deletions

View File

@ -621,10 +621,9 @@ extension AppCoordinator: UISplitViewControllerDelegate {
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool { func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool {
if let shimController = rootSplitViewController.viewControllers.last, if let detailNav = secondaryViewController.children.first as? UINavigationController, let detail = detailNav.topViewController {
let detailNav = shimController.children.first as? UINavigationController,
let detail = detailNav.topViewController as? DetailViewController {
masterNavigationController.pushViewController(detail, animated: false) masterNavigationController.pushViewController(detail, animated: false)
detail.navigationItem.leftBarButtonItem = rootSplitViewController.displayModeButtonItem
return true return true
} }
@ -967,7 +966,9 @@ private extension AppCoordinator {
let systemMessageViewController = UIStoryboard.main.instantiateController(ofType: SystemMessageViewController.self) let systemMessageViewController = UIStoryboard.main.instantiateController(ofType: SystemMessageViewController.self)
let navController = addNavControllerIfNecessary(systemMessageViewController, showButton: false) let navController = addNavControllerIfNecessary(systemMessageViewController, showButton: false)
rootSplitViewController.showDetailViewController(navController, sender: self) let shimController = UIViewController()
shimController.addChildAndPinView(navController)
rootSplitViewController.showDetailViewController(shimController, sender: self)
return navController return navController
} else { } else {