Move NavState ownership to the AppDelegate
This commit is contained in:
parent
e8e0f3b8bd
commit
b877e4dc83
|
@ -40,6 +40,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
|||
var authorAvatarDownloader: AuthorAvatarDownloader!
|
||||
var feedIconDownloader: FeedIconDownloader!
|
||||
|
||||
var navState: NavigationStateController!
|
||||
var masterFeedViewController: MasterFeedViewController!
|
||||
|
||||
var unreadCount = 0 {
|
||||
didSet {
|
||||
if unreadCount != oldValue {
|
||||
|
@ -67,10 +70,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
|||
|
||||
registerBackgroundTasks()
|
||||
|
||||
navState = NavigationStateController()
|
||||
|
||||
// Set up the split view
|
||||
let splitViewController = window!.rootViewController as! UISplitViewController
|
||||
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
|
||||
navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
|
||||
|
||||
let feedNavController = splitViewController.viewControllers[0] as! UINavigationController
|
||||
masterFeedViewController = feedNavController.topViewController as? MasterFeedViewController
|
||||
masterFeedViewController.navState = navState
|
||||
|
||||
let detailNavController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
|
||||
detailNavController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
|
||||
splitViewController.delegate = self
|
||||
|
||||
window!.tintColor = AppAssets.netNewsWireBlueColor
|
||||
|
|
|
@ -19,8 +19,8 @@ class MasterFeedViewController: ProgressTableViewController, UndoableCommandRunn
|
|||
@IBOutlet private weak var addNewItemButton: UIBarButtonItem!
|
||||
|
||||
var undoableCommands = [UndoableCommand]()
|
||||
var navState: NavigationStateController!
|
||||
|
||||
let navState = NavigationStateController()
|
||||
override var canBecomeFirstResponder: Bool {
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue