You can get orientation by 3 ways:
-
UIInterfaceOrientation orientation = self.interfaceOrientation;
returns UIInterfaceOrientation, current orientation of the
interface. It is a property in UIViewController, you can access to
this one only in UIViewController classes. -
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
returns UIInterfaceOrientation, current orientation of the
application’s status bar. You can access to that property in any
point of your application. My experience shows that this is the most
effective way to retrieve real interface orientation. -
UIDeviceOrientation orientation = [[UIDevice currentDevice]
returns UIDeviceOrientation, device orientation.
orientation];
You can access to that property in any point of your
application. But note that UIDeviceOrientation is not always
UIInterfaceOrientation. For example, when your device is on a plain
table you can receive unexpected value.