title: On orientation change to landscape, UINavigationBar in second UIWindow has wrong height, which causes to cover top of view
body: <p>I am using multiple UIWindows, app starts with first UIWindow, and sets up second UIWindow as following:</p>
  
  <pre><code>func onButtonPress() {
      let secondWindow = UIWindow(frame: self.sidebarRect)
      secondWindow.rootViewController = UINavigationController(rootViewController: TableViewController())
  }
  </code></pre>
  
  <p><strong>Issue:</strong> Second UIWindow's <code>UINavigationBar</code> has wrong height <strong>ONLY</strong> when app changes orientation from portrait to landscape, which causes to cover the view.</p>
  
  <p><a href="https://i.stack.imgur.com/Yq2em.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yq2em.jpg" alt="enter image description here"></a></p>
  
  <p>Height is correct (please check screenshots) when app launches second UIWindow in portrait or landscape.</p>
  
  <p><a href="https://i.stack.imgur.com/aYIo4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aYIo4.jpg" alt="enter image description here"></a></p>
  
  <p>I have tried followings:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/a/15729536/1244597">https://stackoverflow.com/a/15729536/1244597</a></li>
  <li><code>positionForBar</code> <code>UIBarPosition.topAttached</code></li>
  </ol>
  
  <p>I am not using autolayout for second UIWindow, another screenshot showing UIWindow is right on the edges of screen and not far</p>
  
  <p><a href="https://i.stack.imgur.com/KrMCU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KrMCU.jpg" alt="enter image description here"></a></p>