Aby Mathew Aby Mathew - 2 years ago 103
Swift Question

How to hide a navigation bar from first ViewController in Swift?

How can I hide a navigation bar from first ViewController or a particular ViewController in swift?

I used the following code in


override func viewDidLoad() {
self.navigationController?.navigationBarHidden = true

and also on

override func viewWillAppear(animated: Bool) {
self.navigationController?.navigationBarHidden = true

Both methods hide the navigation controller from all ViewControllers.

Answer Source

If you know that all other views should have the bar visible, you could use viewWillDisappear to set it to visible again.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download