Search code examples
iosdevice-orientation

iOS >> Device Orientation >> Screen is Not Supporting Upside Down


I have a screen that supports Device Orientation.

Everything is working fine except for the fact that when I rotate the device upside down (home button at top), the rotation doesn't work (it's stuck on the last landscape settings).

I know of several places needed be updated to support this:

  • In the VC itself, I added the methods:

enter image description here

  • In the Project Target, I updated as follow:

enter image description here

  • In the Storyboard VC Scene, I updated as follow:

enter image description here

What am I missing here?


Solution

  • You also have to allow rotating to all orientations in every parent view controller of the current main view controller. For example, if your view controller is in navigation controller, try subclassing it and override the same methods as in your example.

    Edit: As @JordanC mentioned, since iOS 7 you can implement UINavigationControllerDelegate method to return custom supported orientations:

    - (UIInterfaceOrientationMask)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController