Remove obsolete split view controller code
This commit is contained in:
parent
eaf798991f
commit
b8dd63b553
|
@ -852,60 +852,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||
extension SceneCoordinator: UISplitViewControllerDelegate {
|
||||
|
||||
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool {
|
||||
|
||||
// Check to see if the system is currently configured for three panel mode
|
||||
if let subSplit = secondaryViewController as? UISplitViewController {
|
||||
|
||||
// Take the timeline controller out of the subsplit and throw it on the master navigation stack
|
||||
if let masterTimelineNav = subSplit.viewControllers.first as? UINavigationController, let masterTimeline = masterTimelineNav.topViewController {
|
||||
masterNavigationController.pushViewController(masterTimeline, animated: false)
|
||||
}
|
||||
|
||||
// Take the detail view (ignoring system message controllers) and put it on the master navigation stack
|
||||
if let detailNav = subSplit.viewControllers.last as? UINavigationController, let detail = detailNav.topViewController as? DetailViewController {
|
||||
masterNavigationController.pushViewController(detail, animated: false)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// If the timeline controller has been initialized and only the feeds controller is on the stack, we add the timeline controller
|
||||
if let timeline = masterTimelineViewController, masterNavigationController.viewControllers.count == 1 {
|
||||
masterNavigationController.pushViewController(timeline, animated: false)
|
||||
}
|
||||
|
||||
// Take the detail view (ignoring system message controllers) and put it on the master navigation stack
|
||||
if let detailNav = secondaryViewController as? UINavigationController, let detail = detailNav.topViewController as? DetailViewController {
|
||||
// I have no idea why, I have to wire up the left bar button item for this, but not when I am transitioning from three panel mode
|
||||
detail.navigationItem.leftBarButtonItem = rootSplitViewController.displayModeButtonItem
|
||||
detail.navigationItem.leftItemsSupplementBackButton = true
|
||||
masterNavigationController.pushViewController(detail, animated: false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
func splitViewController(_ splitViewController: UISplitViewController, separateSecondaryFrom primaryViewController: UIViewController) -> UIViewController? {
|
||||
|
||||
if isThreePanelMode {
|
||||
return transitionToThreePanelMode()
|
||||
}
|
||||
|
||||
if let detail = masterNavigationController.viewControllers.last as? DetailViewController {
|
||||
|
||||
// If we have a detail controller on the stack, remove it and return it.
|
||||
masterNavigationController.viewControllers.removeLast()
|
||||
let detailNav = addNavControllerIfNecessary(detail, showButton: true)
|
||||
return detailNav
|
||||
|
||||
} else {
|
||||
|
||||
// Display a no selection controller since we don't have any detail selected
|
||||
return fullyWrappedSystemMesssageController(showButton: true)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue