13 Replies
      Latest reply on Mar 2, 2018 7:05 AM by Claude31
      RolfS Level 1 Level 1 (0 points)

        It seems that the iPhoneX portraitUpsideDown screen orientation does not work in the simulator.

        For all other devices it does work.

         

        Update: Still not working with Xcode Version 9.1 beta (9B37)

        • Re: iPhoneX portraitUpsideDown not working
          jeremyhu Apple Staff Apple Staff (160 points)

          I haven't seen any radars filed about this.  Please file a radar at http://bugreport.apple.com, and reference the radar ID here.

          • Re: iPhoneX portraitUpsideDown not working
            Max_B Level 1 Level 1 (5 points)

            When I first saw this fact, I tought it is by design, because of the non-symetric up and down part of the screen. It may turn very difficult to adjust UI display upside-down.

              • Re: iPhoneX portraitUpsideDown not working
                jeremyhu Apple Staff Apple Staff (160 points)

                It is by design.  We're getting documentation updated in a future release to reflect that.

                  • Re: iPhoneX portraitUpsideDown not working
                    RolfS Level 1 Level 1 (0 points)

                    So apps running on iPhoneX will not receive a screen rotation notification if the new orientation = PortraitUpsideDown?

                     

                    Also [[UIDevice currentDevice] orientation] will never return UIDeviceOrientationPortraitUpsideDown?

                    In the current release this is the case, even if UIInterfaceOrientationMaskAllButUpsideDown is returned in the supportedInterfaceOrientations function of UIVIewController (in the iPhoneX case).

                     

                    From a functional point of view, some users might be disappointed that this orientation is not supported. For some of my apps it is used to have the audio cable connection at the top of the device. The alternative, wireless audio, is not always usable because of latency issues.

                      • Re: iPhoneX portraitUpsideDown not working
                        Anaxyrus Americanus Level 1 Level 1 (0 points)

                        > So apps running on iPhoneX will not receive a screen rotation notification if the new orientation = PortraitUpsideDown?

                         

                        Sadly no, at least not according to the simulator. You still get the notification, even though "the rest of the UI" doesn't rotate from its previous orientation.

                         

                        On other iOS 8+ iPhones, the mainScreen bounds will be reported in the correct orientation, e.g., height > width when orientation is UIInterfaceOrientationPortraitUpsideDown. On the iPhone X simulator, though, rotating from landscape to upside-down shows width > height. I'm using that to catch iPhone X upside-downness and not update my UI for the orientation:

                         

                            CGSize screenSize = [[UIScreen mainScreen] bounds].size;
                            NSLog(@"screen size height %f, width %f", screenSize.height, screenSize.width);
                           
                            // check for iPhone X: is orientation upside down, but width >= 667 (not 414, 375, or less as it should be)?
                            // (all 667+ x 375+ devices run iOS 8 or higher, so the reported dims are always rotated as needed)
                            if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown &&
                                screenSize.width >= 667) {
                                NSLog(@"Looks like iPhone X; ignoring rotation.");
                                return;
                            }
                        

                         

                        (The comment on line 5 is in reference to pre-IOS 8 devices, which always reported portrait-orientation bounds regardless. I can't just check for height > width unless I test iOS version as well—I support back to iOS 6 in the affected apps—so it's easier to test for an iPhone-6-or-larger too-wide width value, since all such large-screen iPhones run iOS 8 or later. I'm building the release version with XCode 7.3, so it isn't iPhone X-aware and the UI stays within the safe area, to iOS tells it it has an iPhone 6/7/8 area to work with, but if you're using XCode 9 and the latest SDK I think the same code should work fine.. If this app were universal I'd have to watch out for iPad sizes, too; that complication is left as an exercise for the reader)

                         

                        This seems to work in the sim, even if I switch directly from right-side-up to upside-down. Your mileage may vary, and the actual device may not behave this way, though without an actual device one can't say for sure.

                         

                        If you don't need upside-down, of course, it's easier just to disallow it throughout your app. I need to support headphone-jack hardware (remember headphone jacks?) on older devices, and that hardware wants to be above the device instead of below it, so I still support upside-down when the hardware and firmware allow.

                      • Re: iPhoneX portraitUpsideDown not working
                        Anaxyrus Americanus Level 1 Level 1 (0 points)

                        This is very unfortunate for apps that use hardware docked to the lighting port (for example thermal cameras; light-metering hardware; external microphones). In practical use many of these apps work best with the docked hardware atop the iPhone, e.g., with the iPhone in upside-down portrait orientation. Light-metering apps especially (Lumu Light Meter; Cine Meter II) work best with the sensor elevated, not shadowed by the iPhone or the hand and arm holding it. Using light meters with the sensor at the bottom of the device is awkward at best.

                         

                        Please consider re-supporting upside-down portrait mode in a future build. I realize that means that iPhone-X-aware apps will then need to support three different screen sizes (as when upside-down, the usable height will be decreased since status data can't be tucked in beside the notch), but it'd be worth the pain for the gain in usability for hardware-based apps.

                        • Re: iPhoneX portraitUpsideDown not working
                          Claude31 Level 8 Level 8 (6,205 points)

                          I disovered this iPhoneX limitation very recently. And that's not only for simulator but IRL as well ?

                           

                          I understand it may a bit tricky to conciliate the notch with the bar at the bottom, but there were probably much more complex issues solved, and…

                           

                          That ends up with a surpirsing and bad user experience.

                           

                          Here is a use case:

                          - you have someone in front of you

                          - you want to show him the phone

                          - used just to bend the phone to him to get it the right way

                          - no nome possible, need now to turn the whole phone

                          - if ever it connected to a cable for whatever reason, it is really unpractical.

                           

                          Isn't there a way to get the bar split in 2 parts, along the notch in this situation ? That would be much better than getting the view upside down or keeping in landscape with the bar at right or left !

                           

                          Maybe Apple doesn't want it for its own software, but that should be left available for apps.