iOS 6 auto rotate confusion

Jake Dahl picture Jake Dahl · Sep 22, 2012 · Viewed 19.4k times · Source

I have my entire interface in one Storyboard. How can I make most of the ViewControllers only support a portrait orientation while only a couple supporting all orientations. I can't understand apples new auto rotate system. Also, how can I make this backwards compatable to iOS 5?

Answer

Rafael Nobre picture Rafael Nobre · Sep 26, 2012

In your Navigation Controller subclass, forward the decision to the top view controller in the stack:

-(NSUInteger) supportedInterfaceOrientations {
   return [self.topViewController supportedInterfaceOrientations];
}

Creating a separate storyboard file for this is the worst path to follow, it'll be a maintenance nightmare to keep them in sync with your app updates.