This is my code.
SomeController *analyticsViewController = [[SomeController alloc] init];
MTNavigaionLandscapeViewController *analyticsNavigaionObject = [[MT
Write these methods in your ViewController which you are going to present:
- (BOOL)shouldAutorotate
{
AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
mainDelegate.shouldRotate = YES;
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return YES;
}
In your AppDelegate.m paste this
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if(self.shouldRotate)
{
self.shouldRotate = NO;
return UIInterfaceOrientationMaskLandscapeRight;
}
return UIInterfaceOrientationMaskPortrait;
}
In your AppDelegate.h paste this
@property (assign, nonatomic) BOOL shouldRotate;
In your presentingViewController in ViewWillAppear paste this:
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];