It may be an old post, but it seems relevant. I ran into this problem and thought it might be useful to upgrade to Swift version 4.
Swift 4
override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.setNavigationBarHidden(true, animated: false) } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) navigationController?.setNavigationBarHidden(false, animated: true) }
For example, you should insert it into the controller of the initial view, where you do not want to see the navigation bar. This will hide the navigation bar. And revive it in sight for the next session.
One thing to keep in mind as it animates you, you need to make sure that your restrictions are not aligned to preserve the area that includes the navigation bar, but rather for viewing.
We hope that this will be useful.
source share