penatheboss penatheboss - 3 months ago 10
iOS Question

Multiple segues remove navigation bar in view controller

I have a view controller that has a navigation bar. It is the root view controller of the navigation controller. I have another view controller that can be segued from a button on the first controller. Up to this point, everything works fine; there are navigation bars on both view controllers.

However, from the second view controller, I want to be able to segue back to the first controller. When doing this, it removes the navigation bar from both of the view controllers.

How can I get the navigation bar on both view controllers with buttons as transitions? Thanks!

Answer

Implement below method in your both viewcontroller,

 - (void) viewWillAppear:(BOOL)animated
{
[self.navigationController setNavigationBarHidden:NO animated:NO];
[super viewWillAppear:animated];
}

You may hiding navigationbar somewhere.

Comments