My application is running in landscape mode. I want it to launch always in this orientation:
If you are holding it the other way when it launches it should flip, but without the rotation animation. How do i achieve that?
My application is running in landscape mode. I want it to launch always in this orientation:
If you are holding it the other way when it launches it should flip, but without the rotation animation. How do i achieve that?
When launching application, You can check current orientation with:
UIDevice myDevice = [UIDevice currentDevice];
[myDevice beginGeneratingDeviceOrientationNotifications];
UIDeviceOrientation currentOrientation = [myDevice orientation];
Device orientation can be:
typedef enum {
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait,
UIDeviceOrientationPortraitUpsideDown,
UIDeviceOrientationLandscapeLeft,
UIDeviceOrientationLandscapeRight,
UIDeviceOrientationFaceUp,
UIDeviceOrientationFaceDown
} UIDeviceOrientation;
Once You know it should be rotated,
You can - use this answer: UINavigationController Force Rotate
Or - if only iOS 5 and up is supported: https://stackoverflow.com/a/9827763/894671
Or - if iOS 6 only: https://stackoverflow.com/a/12691744/894671
Good luck!
If you only want to use Landscape Right, you should simply unselect Landscape Left.
However, note that Apple may knock your submission back, as they tend to like orientations being supported where possible.