Skip to content

Instantly share code, notes, and snippets.

@olxios
Created June 20, 2016 19:01
Show Gist options
  • Save olxios/cf999ff98be85f83069fa76bc0cac384 to your computer and use it in GitHub Desktop.
Save olxios/cf999ff98be85f83069fa76bc0cac384 to your computer and use it in GitHub Desktop.
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if ([self.window.rootViewController.presentedViewController isKindOfClass:[SecondViewController class]])
{
SecondViewController *secondController = (SecondViewController *) self.window.rootViewController.presentedViewController;
if (secondController.isPresented) // Check current controller state
{
return UIInterfaceOrientationMaskAll;
}
else return UIInterfaceOrientationMaskPortrait;
}
else return UIInterfaceOrientationMaskPortrait;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment