Keep table selections when root split isn't collapsed

This commit is contained in:
Maurice Parker 2019-08-02 10:25:47 -05:00
parent 52055d83f5
commit 54f6607621
3 changed files with 10 additions and 1 deletions

View File

@ -67,6 +67,10 @@ class AppCoordinator: NSObject, UndoableCommandRunner {
return TreeController(delegate: treeControllerDelegate)
}()
var isRootSplitCollapsed: Bool {
return rootSplitViewController.isCollapsed
}
var isThreePanelMode: Bool {
return rootSplitViewController.traitCollection.userInterfaceIdiom == .pad && rootSplitViewController.displayMode == .allVisible
}

View File

@ -53,8 +53,8 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
}
override func viewWillAppear(_ animated: Bool) {
clearsSelectionOnViewWillAppear = true
navigationController?.title = NSLocalizedString("Feeds", comment: "Feeds")
clearsSelectionOnViewWillAppear = coordinator.isRootSplitCollapsed
super.viewWillAppear(animated)
}

View File

@ -54,6 +54,11 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
}
override func viewWillAppear(_ animated: Bool) {
clearsSelectionOnViewWillAppear = coordinator.isRootSplitCollapsed
super.viewWillAppear(animated)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
becomeFirstResponder()