Skip to content

Instantly share code, notes, and snippets.

@olxios
Created June 20, 2016 19:02
Show Gist options
  • Save olxios/42b4c9d489520bf8c890dc1f998af45e to your computer and use it in GitHub Desktop.
Save olxios/42b4c9d489520bf8c890dc1f998af45e to your computer and use it in GitHub Desktop.
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {
if self.window?.rootViewController?.presentedViewController is SecondViewController {
let secondController = self.window!.rootViewController!.presentedViewController as! SecondViewController
if secondController.isPresented { // Check current controller state
return UIInterfaceOrientationMask.All;
} else {
return UIInterfaceOrientationMask.Portrait;
}
} else {
return UIInterfaceOrientationMask.Portrait;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment