title: How to get statusBarOrientation on first view
body: <p>How does one detect the correct orientation of the application on the first view? I need to know so I can either display a portrait image or landscape image as the background.</p>
  
  <p><code>[[UIDevice currentDevice] orientation]</code> doesn't work properly if the iPad is laid down flat on a surface.</p>
  
  <p><code>statusBarOrientation</code> doesn't seem to return the correct results for the very first view that is loaded. I tried getting the status bar orientation in the <code>viewWillAppear</code> and <code>viewDidLoad</code> and both returned <strong>Portrait</strong> even when in landscape.</p>
  
  <p>I have confirmed that I have <code>[self.window makeKeyAndVisible]</code> in my <code>AppDelegate.m</code> in <code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions</code>. This is only returning the incorrect status bar orientation on the first view controller.</p>
  
  <p>Note: I have also tried the <code>interfaceOrientation</code> from the <code>UIViewController</code>, ad that still returns portrait no matter what.</p>
  
  <p>Any ideas how to fix this?</p>
  
  <p>EDIT:</p>
  
  <p>I am using the <code>[[UIDevice currentDevice] orientation]</code> to detect if it is portrait or landscape but my issue is detecting what the view actually is if UIDevice returns an orientation of flat (non portrait or landscape).</p>