Why doesn't "Upside down" work?

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?

Accepted Reply

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)

Replies

Is it for iPhone X ?


iPhoneX does not support upside down.

The same applies on my physical iphone 6s.
But that's a nuisance, that the X doesn't do upside down. I frequently have my phone upside down for GPS apps like Maps, so that I can place it in a holding area in the car with the power cable attached, which is only doable if the phone is upside down.

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)

I filed a bug report for enhancement so that iPhoneX support upside down.

#40746578: Upside down for notched iPhones


There are many situations where this could be useful: you speak to someone, in front of you, and want to show him the page content. No way just to flip ; you now have to turn physically the phone. A serious usuability regression. ANd more and more annoying, as the notch generalizes on more and more iPhones.


Sure, the bar at the bottom is an issue ; but may be, in upside down position, the bar could be split in two, to fit in the 2 ears ?


I would advise you to file a bug report as well.

Yes, I got the upside down mode working with the override you suggested above, testing on an SE. But on the iphone X simulator, the app didn't rotate to keep the UI upright. You are right. It seems like a silly bug.

Not really a bug, but a bad feature in iPhoneX.


Unfortunately, that could extend to more iPhones or iPad in the future. I understand that is was is being prepared with the default value of allButUpsideDown.


So, file a bug for suggestion.