title: How should I determine how to orient a view in landscape if the UIInterfaceOrientation landscape values are the same constant?
body: <p>I want to present a view that responds to orientation changes but for various reasons can't use iOS's built-in autorotation.  In <code>viewDidLoad</code> I use the current orientation to determine the initial layout of the view:</p>
  
  <pre><code>_originalOrientation = [UIDevice currentDevice].orientation;
  
  // if we were launched flat or unknown, use the status bar orientation as a guide
  if (_originalOrientation == UIDeviceOrientationUnknown ||
      _originalOrientation == UIDeviceOrientationFaceDown ||
      _originalOrientation == UIDeviceOrientationFaceUp) {
  
          _originalOrientation = UIDeviceOrientationFromInterfaceOrientation([UIApplication sharedApplication].statusBarOrientation);
  }
  </code></pre>
  
  <p>As you can see from my comment, I need to handle the case where <code>[UIDevice currentDevice].orientation</code> is not a usable direction (i.e. the device is flat or in an unknown orientation).  In this scenario, I attempt to use the <code>statusBarOrientation</code> to infer the device's orientation (using <code>UIViewController</code>'s <code>interfaceOrientation</code> would be an alternative way to get the same information):</p>
  
  <pre><code>UIDeviceOrientation UIDeviceOrientationFromInterfaceOrientation(UIInterfaceOrientation interface) {
      // note: because UIInterfaceOrientationLandscapeLeft and UIInterfaceOrientationLandscapeRight have the same value, this conversion can't distinguish them
  
      if (interface == UIInterfaceOrientationLandscapeLeft) {
          return UIDeviceOrientationLandscapeLeft;
  
      } else if (interface == UIInterfaceOrientationLandscapeRight) {
          return UIDeviceOrientationLandscapeRight;
  
      } else if (interface == UIInterfaceOrientationPortraitUpsideDown) {
          return UIDeviceOrientationPortraitUpsideDown;
  
      } else {
          return UIDeviceOrientationPortrait;
      }
  }
  </code></pre>
  
  <p>However my logic can't accurately discern the two landscape cases because they are defined <code>UIApplication.h</code> to be the <em>same</em> constant value:</p>
  
  <pre><code>// Note that UIInterfaceOrientationLandscapeLeft is equal to UIDeviceOrientationLandscapeRight (and vice versa).
  // This is because rotating the device to the left requires rotating the content to the right.
  typedef NS_ENUM(NSInteger, UIInterfaceOrientation) {
      UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
      UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
      UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
      UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft
  };
  </code></pre>
  
  <p>Is there an alternative way I can distinguish between <code>UIInterfaceOrientationLandscapeLeft</code> and <code>UIInterfaceOrientationLandscapeRight</code>?  Is there a better way for me to perform my "fallback" logic besides using the status bar orientation?</p>