0

Is it possible to support all orientations yet once the view is loaded in the launched orientation disallow the user from then rotating orientation? So say we have a loading screen which is launched in portrait, we want to disable any rotation on this screen. Same goes for if the app is launched in landscape, then we want to disallow rotation to portrait.

kschins
  • 1,054
  • 1
  • 13
  • 26
  • http://stackoverflow.com/questions/17370806/disable-autorotate-on-a-single-uiviewcontroller-in-ios6 – Piyush Aug 27 '15 at 22:07

1 Answers1

0

you need to subclass 'UINavigationController', implement shouldAutorotate and use your navigation controller class in your storyboard.

override the shouldAutorotate method on the initial view controller. This method is called before performing any autorotation. If it returns NO, then the rotation is suppressed.

- (BOOL)shouldAutorotate{
id currentViewController = self.topViewController;

if ([currentViewController isKindOfClass:[DetailViewController class]])
    return NO;

return YES;}

good luck

ahmedHegazi
  • 190
  • 1
  • 14