Created
February 13, 2016 11:39
-
-
Save NickAger/be37b6afecb1868a3ba8 to your computer and use it in GitHub Desktop.
iPhone upside down
This file contains 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
// MARK: Allow iPhone to work upside-down | |
extension ViewController { | |
// allow the iPhone to work upside down; by default on the iPhone this method returns UIInterfaceOrientationMaskAllButUpsideDown | |
// http://stackoverflow.com/questions/12542472/why-iphone-5-doesnt-rotate-to-upsidedown/12758715#12758715 | |
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { | |
return UIInterfaceOrientationMask.All | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Swift 3 it becomes:
also I found I need to add the above to UINavigationController if the app uses one
and also check "Requires full screen" on the iPad
see: http://stackoverflow.com/questions/35274428/supportedinterfaceorientations-not-called-in-ipad