ylliX - Online Advertising Network

interfaceOrientation is deprecated in iOS8

Are you still using self.interfaceOrientation and getting deprecation warning? Well, don’t. Not only because it is depracated, but it can give you wrong result. Device might be in landscape mode, but a view controller that only supports portrait will remain in portrait. Solution for everything is:

[[UIApplication sharedApplication] statusBarOrientation]

which will not only return correct orientation, but also result is UIInterfaceOrientation enum so you don’t need to change your switches.

Leave a Reply