Created
June 20, 2016 19:02
-
-
Save olxios/42b4c9d489520bf8c890dc1f998af45e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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