There’re 3 ways to get current interface orientation that I know of:
self.interfaceOrientation[[UIApplication sharedApplication] statusBarOrientation][[UIDevice currentDevice] orientation]
What are the differences among them?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
self.interfaceOrientationreturns UIInterfaceOrientation, current orientation of the interface. It is a property in UIViewController, you can access to this one only in UIViewController classes.[[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 it’s more effective way to retrieve real interface orientation.[[UIDevice currentDevice] orientation]returns UIDeviceOrientation, device 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.