Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
iPhone upside down
// 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
}
}
@NickAger

This comment has been minimized.

Copy link
Owner Author

NickAger commented Aug 16, 2016

For Swift 3 it becomes:

override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
    return [.landscape]
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.