Skip to content

Instantly share code, notes, and snippets.

@sumardi
Created June 6, 2013 12:14
Show Gist options
  • Save sumardi/5721069 to your computer and use it in GitHub Desktop.
Save sumardi/5721069 to your computer and use it in GitHub Desktop.
Force UIViewController to portrait orientation in iOS 6. Create a new category from UINavigationController and override the rotation methods.
-(BOOL)shouldAutorotate
{
return [self.topViewController shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [self.topViewController preferredInterfaceOrientationForPresentation];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment