Ivan Ivan - 5 months ago 12
Swift Question

Why I can't see Top bar, after navigationcontroller go back programmatically

I have navigation controller with rootViewController and childViewController.
When I start my app I see Top Bar on my rootViewController. Then I go to childViewController trough segue and than try to return to rootViewController

@IBAction func exitButtonAction(sender: AnyObject) {
navigationController?.popToRootViewControllerAnimated(true)
}


but it is start without Top Bar.
I go back programmatically, because on my childViewController Top Bar is hidden.
How can I fix it?

Answer

This is a boolean value that can solve what you need: self.navigationController?.navigationBarHidden = true

Set it to true or false when you need to.

Comments