Reputation: 1163
I'm looking for a quick way to tell if the device is being held with the home button to the right or to the left. Is there a function to do so?
Upvotes: 2
Views: 2549
Reputation: 3895
Look at the UIDevice
documentation. There is an orientation property available. Something like:
UIDeviceOrientation d = [[UIDevice currentDevice] orientation];
The values of d
you are looking for are:
UIDeviceOrientationLandscapeLeft
- The device is in landscape mode, with the device held upright and the home button on the right side.
UIDeviceOrientationLandscapeRight
- The device is in landscape mode, with the device held upright and the home button on the left side.
Upvotes: 7