title: UINavigationController push viewcontroller with hidden navigationbar
body: <p>I have a <code>UINavigationController</code> and its <code>navigationBar</code> hides if the user scrolls (done with <code>UIScrollViewDelegate</code>, not with pan gesture). </p>
  
  <p>But when I push a a new <code>viewController</code> onto the stack, the new controller's view's origin y is at 64px and not where the old <code>topViewController</code>'s y was (which is 21px). </p>
  
  <p>How can I make the push, so that the new controller appears at the same position as the old one was? </p>
  
  <p>The only place that updating the view's frame was successful was in <code>viewDidAppear</code>, but that's to late, because the user can see a black space on the top for a second.</p>
  
  <p><em>Updated:</em></p>
  
  <p>It seams like it has to be done between <code>viewWillAppear</code> and <code>viewDidAppear</code>, but I can not find reasonable method to do this.</p>
  
  <p>Tried to alter the <code>UINavigationController</code>'s view (currently I'm just moving it's <code>navigationBar</code>), but that messes up the layout.</p>
  
  <p><em>Update again:</em></p>
  
  <p>Some more info, because none of the answers and comments helped. The navigationcontroller is instantiated from storyboard. It's a custom <code>UINavigationController</code>, which hides the <code>navigationBar</code> on it's <code>topViewController</code>'s <code>scrollView</code> scrolling (nothing else is overwritten). </p>
  
  <p>The first <code>topViewController</code> (from which the push is started) is a <code>UIViewController</code> with 2 container view (one if logged in, other if not). The second <code>topViewController</code> (the one which is pushed onto the stack) is a <code>UIViewController</code> with a full screen <code>UIWebView</code>. </p>
  
  <p>Everything is coming from the storyboard. All the <code>Extended Edges</code> checkboxes are off for every <code>viewController</code> and all the <code>navigationBars</code> are opaque. <code>AutoLayout</code> is used everywhere and (I think setup right).</p>