My app build with ECSlidingViewController 2.0 as the sliding menu. I would like to disable the rotate for only one UIViewController . all my UIViewController start with UINavigationController.
I have make a SubClass of UINavigationController to implement the methods and assign the subclass to all UINavigationController in the sotryboard. but it does not work. it seems the code not triggered.
Inside MyNavigationController.m :
#import "MyNavigationController.h"
#import "ContactUsViewController.h"
@interface MyNavigationController ()
@end
@implementation MyNavigationController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (BOOL)shouldAutorotate {
NSLog(self.topViewController.description);
if ([self.topViewController isMemberOfClass:[ContactUsViewController class]]){
return NO;
}else{
return YES;
}
}
@end
ContactUsViewController is the UIViewController i don't want to rotate.