1

I have tried:

--> Subclassing UINavigationController and overriding autorotate methods

--> Overriding autorotate methods on MyViewController

--> And both.

Note: Also, I tried with autorotate sets NO and YES

This is my code:

NavigationControllerNoAutorotate:

@implementation NavigationControllerNoAutorotate

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationPortrait;
}

- (BOOL)shouldAutorotate {
    return YES;
}

@end

MyViewController:

- (BOOL)shouldAutorotate {
    return NO;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}


- (UIInterfaceOrientationMask)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController {
    return UIInterfaceOrientationPortrait;
}
93sauu
  • 3,770
  • 3
  • 27
  • 43
  • The problem was that I was testing on iPad, and I activated the SplitView on deployment info. When "Requires Full Screen" is YES, split view is deactivated. – 93sauu Oct 24 '16 at 13:00
  • I found the solution on this link:[link]http://stackoverflow.com/questions/32782044/ios-9-supportedinterfaceorientations-not-working – 93sauu Oct 24 '16 at 14:15

1 Answers1

1

The problem was that I was testing on iPad, and I activated the SplitView on deployment info. When "Requires Full Screen" is YES, split view is deactivated.

I found the solution on this LINK

Community
  • 1
  • 1
93sauu
  • 3,770
  • 3
  • 27
  • 43