title: iOS 8 - UIWindow Orientation Is Always Portrait
body: <p>I am updating an iOS 6 app to iOS 8 (iPad), and any new <code>UIWindows</code> that I create are always showing up in Portrait mode. The app originally supported both the Portrait and Landscape orientations but now will only support Landscape.</p>
  
  <p>I've changed the supported orientations in the project file to Landscape Left and Landscape Right. The entire UI shows up in landscape, as expected, but when I create a new <code>UIWindow</code>, it shows up in portrait. The new <code>UIWindow</code>'s frame matches the screen's frame exactly, so I can't imagine why/how it is showing up in portrait mode.</p>
  
  <p>The following code is what I am using to create and show the new <code>UIWindow</code>, which acts as a modal:</p>
  
  <pre><code>var modalWindow:UIWindow = UIWindow(frame: self.view.window!.bounds)
  
  modalWindow.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.66)
  modalWindow.hidden = false
  modalWindow.windowLevel = (UIWindowLevelStatusBar + 1)
  
  modalWindow.addSubview(customView)    
  
  modalWindow.makeKeyAndVisible()
  </code></pre>
  
  <p>I've been struggling with this for a few hours; shouldn't the <code>UIWindow</code> be in landscape mode by default since the app only supports the Landscape orientation?</p>
  
  <p>I would greatly appreciate any advice on how to resolve this issue.</p>
  
  <p>EDIT:</p>
  
  <p>I just created a new test app that only supports Landscape Left and Landscape Right, and the issue occurs there as well. Is this a bug? I can't seem to understand why the UIWindow would think the app is in Portrait mode when it's in Landscape mode.</p>