I have view that is displayed in landscape mode. I want to modally display a new view controller with a portrait orientation (so that is looks like it’s sliding in from the right). Currently, when I execute the code below, it modally displays the new view controller in the same landscape orientation that the calling view controller has. How can I modally display a new view controller with a portrait orientation, from a view controller that has a landscape orientation?
Here’s my existing code...
//This code is called from the landscape view controller
- (void)showPortraitViewControllerButtonTapped
{
MyViewController *vc = [MyViewController new];
UINaviationViewController *navVC = [[UINavigationViewController alloc] initWithRootViewController:vc];
[self presentViewController:navVC animated:YES completion:nil];
}
//Code inside the view controller that I want to modally display in portrait orientation
@implementation MyViewController
(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
@end
Thanks in adavnce for your wisdom!