0

I have embedded my story board view controllers with the navigation controller. However, I want one view specific controller to not have the navigation bar. How can I do this?

nhgrif
  • 61,578
  • 25
  • 134
  • 173
Nik F
  • 71
  • 1
  • 11

1 Answers1

3

Hide the navigation bar in viewWillAppear.

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

Also, make sure you have it appear again when you leave that particular view controller. I usually do this in viewWillDisappear.

override func viewWillDisappear(animated: Bool) {
    super.viewWillDisappear(animated)
    self.navigationController?.navigationBarHidden = false
}
user3353890
  • 1,844
  • 1
  • 16
  • 31