Question

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?

Was it helpful?

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

OTHER TIPS

As @eGanges mentioned the key point could be to subclass your UITabBarController (and override supportedInterfaceOrientations) if that is your initial view controller, in that case this is the only controller you should subclass (and of course you should add all the supported interface orientations to your app Info.plist file UISupportedInterfaceOrientations key)

Have you tested on real device?

anyway try this:

- (NSUInteger)supportedInterfaceOrientations {
    return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top