From b8dd63b55310bcd4eca541454730e30781cacd3a Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 23 Sep 2019 17:56:10 -0500 Subject: [PATCH] Remove obsolete split view controller code --- iOS/SceneCoordinator.swift | 53 -------------------------------------- 1 file changed, 53 deletions(-) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index ae8e43b85..baed463b2 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -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) - - } } }