Hi
I have an app that doesn't work in landscape mode, but I would like it to work upside down. So in the project's General settings, Deployment Info, for Device orientation, I have Portrait and Upside Down checked, and Landscape Left and Landscape Right unchecked.
But when I run it and turn the phone upside down, the app stays fixed to the phone, and doesn't show right side up.
Is there something else I need to set?
have you checked as well your info.plist ? In SupportedInterfaceOrientation, check the orientations.
You have to override supportedInterfaceOrientations :
override open var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return .all
}It seems that the default value of UIInterfaceOrientationMask is now allButUpsideDown
Note:
That will not make it work on iPhone X.
Here the constant values :
portrait UIInterfaceOrientationMask(rawValue: 2)
portraitUpsideDown UIInterfaceOrientationMask(rawValue: 4)
landscapeRight UIInterfaceOrientationMask(rawValue: 8)
landscapeLeft UIInterfaceOrientationMask(rawValue: 16)
landscape UIInterfaceOrientationMask(rawValue: 24)
allButUpsideDown UIInterfaceOrientationMask(rawValue: 26)
all UIInterfaceOrientationMask(rawValue: 30)