diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index eb4be908..a49dfad3 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -266,9 +266,7 @@ import UIKit } // Handle data for first load. Dispatched to allow subclasses to finish their view did load implementations. - DispatchQueue.main.async { - self.handleNewDataAndUpdateUI() - } + self.handleNewDataAndUpdateUI() } open override func viewDidLayoutSubviews() { @@ -292,8 +290,10 @@ import UIKit open override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - // Update the navigation bar ui when view is appearing - setNavigationController() + // Update the navigation bar ui when view is appearing. Can remove check in the future, see viewControllerReady + if manager == nil { + setNavigationController() + } } open override func viewDidAppear(_ animated: Bool) { @@ -326,6 +326,10 @@ import UIKit // MARK: - MVMCoreViewManagerViewControllerProtocol open func viewControllerReady(inManager manager: UIViewController & MVMCoreViewManagerProtocol) { + // TODO: This check and set aren't technically needed anymore. The one in viewwillappear should be enough. However, there is a timing issue with the manager where the screen lays out before the menu shows, so the screen grows off the screen. Can fix in the future. + if let _ = self.view { + setNavigationController() + } // Janky way to track current page. MVMCoreUISession.sharedGlobal()?.currentPageType = pageType MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self)