Create an empty article controller if we are separating controllers and one doesn't exist. Issue #1172 & Issue #1177

This commit is contained in:
Maurice Parker 2019-11-03 18:10:49 -06:00
parent 0fa8ddd384
commit 48b475a33c
1 changed files with 10 additions and 0 deletions

View File

@ -939,6 +939,16 @@ extension SceneCoordinator: UISplitViewControllerDelegate {
return currentArticle == nil
}
func splitViewController(_ splitViewController: UISplitViewController, separateSecondaryFrom primaryViewController: UIViewController) -> UIViewController? {
if masterNavigationController.viewControllers.count == 3 {
return nil
} else {
let articleViewController = UIStoryboard.main.instantiateController(ofType: ArticleViewController.self)
articleViewController.coordinator = self
return articleViewController
}
}
}
// MARK: UINavigationControllerDelegate