title: Push / Pop View Controller With Navigation Bar from View Controller Without Navigation Bar
body: <p>I'm trying to push a view controller with a visible navigation bar from a view controller with a hidden navigation bar. </p>
  
  <p>I tried all sorts of combinations of <code>[[self navigationController] setNavigationBarHidden:YES animated:NO];</code> in viewWillAppear, viewDidAppear, viewWillDisappear... etc. </p>
  
  <pre><code>// First View Controller
  
  @implementation FirstViewController
  
  - (void)viewWillAppear:(BOOL)animated {
      [super viewWillAppear:animated];
      [[self navigationController] setNavigationBarHidden:YES animated:NO];
  
      NSLog(@"[%@ viewWillAppear]", self);
  }
  
  @end
  
  
  // Second View Controller
  
  
  @implementation SecondViewController
  
  - (void)viewWillAppear:(BOOL)animated {
      [super viewWillAppear:animated];
      [[self navigationController] setNavigationBarHidden:NO animated:NO];
  
      NSLog(@"[%@ viewWillAppear]", self);
  }
  
  @end
  </code></pre>
  
  <p>Nothing worked. I also tried custom code to "animate" a push and pop, which works, BUT I lose the edge swipe and view panning. Before I dig deeper, just want to make sure I'm not reinventing the wheel. </p>
  
  <p>The Starbucks app is what I'm trying to mimic. </p>
  
  <p>The root view controller of the app (the dark background view) is full screen and notice how it doesn't have a UINavigationBar. But when you tap on one of the buttons, it pushes on a view controller (the light background view) WITH a UINavigationBar. From there, if you tap the "back" arrow, it view controller pops with the navigation bar. Interactive pop swipe gesture also works.</p>
  
  <p><img src="https://i.stack.imgur.com/QHPz7.png" alt="Starbucks iOS App"></p>