5 steps (I am running with Storyboard and IOS 7)
- Subclass the ECSlidingViewController. (eg. MyECSlidingViewController)
- Create your own shouldAutorotate and supportedInterfaceOrientations in the MyECSlidingViewController.
- SubClass the UINavigationController and assign to all your existing UINavigationController. (eg. MyNavigationController)
- Create your own shouldAutorotate and supportedInterfaceOrientations in the MyNavigationController.
- in the UIViewController you want to set to Portrait only.
MyECSlidingViewController.m
-(BOOL)shouldAutorotate
{
return [self.topViewController shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
MyNavigationController.m
-(BOOL)shouldAutorotate
{
return [[self.viewControllers lastObject] shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
YourViewController.m
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
Hope it helps !