I have this app I am working on and I need ALL my view controllers but one to be in portrait. The single one view controller that is special I need it to be able to rotate t
This is actually easier and can be done without any additional properties (here's an example with AVPlayerViewController
):
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if ([self.window.rootViewController.presentedViewController isKindOfClass: [AVPlayerViewController class]])
return self.window.rootViewController.presentedViewController.isBeingDismissed ?
UIInterfaceOrientationMaskPortrait : UIInterfaceOrientationMaskAll;
else
return UIInterfaceOrientationMaskPortrait;
} else {
return UIInterfaceOrientationMaskAll;
}
}