Is there a special method to get iPhones orientation? I don\'t need it in degrees or radians, I want it to return an UIInterfaceOrientation object. I just need it for an if-else
UIInterfaceOrientation
is now deprecated, and UIDeviceOrientation
includes UIDeviceOrientationFaceUp
and UIDeviceOrientationFaceDown
so can't be relied on to give you the interface orientation.
The solution is pretty simple though
if (CGRectGetWidth(self.view.bounds) > CGRectGetHeight(self.view.bounds)) {
// Landscape
} else {
// Portrait
}