I would like to make ViewController A portrait and ViewController B landscape. When it runs, all goes portrait even I set app delegate to change as landscape. Would you please tell what to do exactly? The below is my working ..
ViewController A going to view controller B :
AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
appDelegate.restrictRotation = TRUE;
MapViewController * sliderVC = [[MapViewController alloc] init ];
sliderVC.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:sliderVC animated:NO completion:nil];
sliderVC.view.backgroundColor = [UIColor clearColor];
AppDelegate.m
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if(self.restrictRotation)//set the bool value to view controller which you want to load in landscape
return UIInterfaceOrientationMaskLandscapeRight;
else
return UIInterfaceOrientationMaskPortrait;
}