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,11 +621,10 @@ 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, masterNavigationController.pushViewController(detail, animated: false)
let detail = detailNav.topViewController as? DetailViewController { detail.navigationItem.leftBarButtonItem = rootSplitViewController.displayModeButtonItem
masterNavigationController.pushViewController(detail, animated: false) return true
return true
} }
if let subSplit = secondaryViewController.children.first as? UISplitViewController { if let subSplit = secondaryViewController.children.first as? UISplitViewController {
@ -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 {