Disable autorotate on a single UIViewController not working in iPad Pro

Viewed 5559

I want to lock single viewcontroller in iPhone and iPad. This below code is working perfectly in iPhone 4,5,6 iPad, iPad 2 ,iPad retina. But not working in iPad pro.

@implementation UINavigationController (Orientation)
-(NSUInteger)supportedInterfaceOrientations
{
        return [self.topViewController supportedInterfaceOrientations];
}

-(BOOL)shouldAutorotate
{
    return YES;
}
@end

This above code is written in my view controller which view controller i do not want to rotate.

2 Answers
Related