So I've searched through a few pages and found some answers here on stack overflow, but nothing seems to be working.
I have a root view controller. It has 2 children view controllers. (a base content view and a menu overlay).
The goal is to have the content view respond to orientation change, but the overlay menu to only display in portrait (design choices makes much more sense in context)
In my root VC I've added my children views in this manner:
self.contentVC = [DELEGATE.storyboard instantiateViewControllerWithIdentifier:@"content"];
[self addChildViewController:self.contentVC];
self.contentVC.view.frame = self.view.bounds;
[self.view addSubview:self.contentVC.view];
[self.contentVC didMoveToParentViewController:self];
And root VC has following methods declared:
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
-(BOOL)shouldAutomaticallyForwardAppearanceMethods{
return YES;
}
-(BOOL) shouldAutomaticallyForwardRotationMethods{
return YES;
}
-(BOOL)shouldAutorotate
{
return YES;
}
In my conentVC:
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
-(BOOL)shouldAutorotate
{
return YES;
}
And in the menuVC:
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
-(BOOL)shouldAutorotate
{
return NO;
}
I programmatically solved this by just having the rootVC call a method on contentVC that positions and rotates elements, and this is working fine right now. My main concern is that if apple adds more screen sizes, autorotate is much more adaptable. Is there an autorotate solution I am missing?
As stated, I've checked some posts out already and know that similar things have been discussed, but any solutions I've found dont seem to work.