I have a UINavigationController (Parent) that is pushing a UIViewController (Child). I understand that both need to support:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES; //(interfaceOrientation == UIInterfaceOrientationPortrait);
}
However, I don't want the parent to be able to rotate to landscape orientation. How can I enforce this?
UPDATE:
My Parent has been updated to:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (interfaceOrientation != UIInterfaceOrientationLandscapeRight ||interfaceOrientation != UIInterfaceOrientationLandscapeLeft )
return NO;
else
return YES;
}
But now the child doesn't rotate.