Skip to content

Instantly share code, notes, and snippets.

@markSci5
Created July 9, 2013 07:52
Show Gist options
  • Save markSci5/5955478 to your computer and use it in GitHub Desktop.
Save markSci5/5955478 to your computer and use it in GitHub Desktop.
Allow navigation controller's view controllers to follow their own orientation rules
@interface UINavigationController (autorotation)
-(BOOL)shouldAutorotate;
-(NSUInteger)supportedInterfaceOrientations;
@end
@implementation UINavigationController (autorotation)
-(BOOL)shouldAutorotate
{
[self.topViewController shouldAutorotate];
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment