I\'m using a storyboard and I\'m trying to hide a top bar of my main navigation controller when a certain button is pressed (or function is called). I know I have to initial
The answers are correct. Just want to add that you probably want to put back the navigation bar when leaving the view as other views might use it and when you hide for one its hidden for all.
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.isHidden = true
}
and before you leave the view:
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.navigationBar.isHidden = false
}
`