title: How Do I detect the orientation of the device on iOS?
body: <p>I have a question on how to detect the device orientation on iOS. I don't need to receive change notifications, just the current orientation itself. This seems to be a rather simple question, but I haven't been able to wrap my head around it. Below is what I have done so far:</p>
  
  <pre><code>UIDevice *myDevice = [UIDevice currentDevice] ;
  [myDevice beginGeneratingDeviceOrientationNotifications];
  UIDeviceOrientation deviceOrientation = myDevice.orientation;
  BOOL isCurrentlyLandscapeView = UIDeviceOrientationIsLandscape(deviceOrientation);
  [myDevice endGeneratingDeviceOrientationNotifications];
  </code></pre>
  
  <p>In my mind this should work. I enable the device to receive device orientation notices, then ask for what orientation it is in, but then it is not working and I don't know why.</p>