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.
Well i kinda hacked my way around this one. here is my Subclassed NavController.h
#import "RootVC.h"
@implementation RootVC
-(BOOL)shouldAutorotate {
def = [NSUserDefaults standardUserDefaults];
return YES;
}
-(NSUInteger)supportedInterfaceOrientations {
if ([def integerForKey:@"Should Rotate"] == 1) {
return UIInterfaceOrientationMaskAllButUpsideDown;
} else {
return UIInterfaceOrientationMaskPortrait;
}
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationMaskPortrait;
}
@end
I just set an integer for @"Should Rotate" in defaults on each View Controller in
- (void)viewWillAppear:(BOOL)animated
works like a charm!