Hide the navigation bar on the root view controller and show it differently - Swift

I need to hide the navigation bar only from the root view controller,

when I try to hide it from the storyboard by disabling the "Show Navigation Bar", it is hidden from all other view controllers connected to this root view controller.

what could be a possible solution?

+7
ios iphone swift
source share
1 answer

I solved this with this code:

override func viewWillDisappear(animated: Bool) { self.navigationController?.setNavigationBarHidden(false, animated: animated); super.viewWillDisappear(animated) } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) self.navigationController?.setNavigationBarHidden(true, animated: animated) } 
+19
source share

All Articles