Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone X: What triggers compatibility mode vs. full-screen mode?

Tags:

ios

iphone-x

I’m trying to get a fairly complex, existing codebase (base SDK iOS 9.0; Swift 4.0; Xcode 9.1) to run in full-screen mode on iPhone X, and so far, it only runs in “compatibility mode” (i.e., letterboxed with black top and bottom borders).

However, a brand-new Xcode project meeting the same requirements runs in full-screen mode fine.

There also seems to be a fair amount of ambiguity and/or misinformation regarding when an app running on iPhone X actually displays in “compatibility mode” vs. full-screen mode.

Some of the variables may include:

  • the Base SDK project setting
  • whether there’s a Launch storyboard
  • whether there are iPhone X launch images, and their sizes
  • whether Safe Area guides are enabled

... and possibly more.

Apart from what Apple (and others) say, has anyone definitively isolated precisely which permutation(s) of parameters ‘flips the switch’, and causes the app to run in one vs. the other when on iPhone X?

[Please note: for business reasons, and at least for the moment, we still want the app to be able to run on iOS 9 and up.]

Many thanks in advance!

like image 893
RonDiamond Avatar asked Nov 09 '17 11:11

RonDiamond


1 Answers

To break out of the letterbox on iPhone X, your app needs:

  1. To be compiled against the iOS 11.0 (or newer) SDK
  2. To have appropriate launch screen assets — either a launch storyboard with Auto Layout, or iPhone X launch images in the asset catalog.

Making use of Safe Area guides isn't part of getting out of the compatibility mode letterboxing, but it is essential to making sure your UI properly fits on iPhone X after you get out of compatibility mode. For many apps, just doing steps 1 and 2 above will result in UI that stretches to fill the whole screen, hiding important controls behind (or uncomfortably close to) the rounded corners, home indicator, and sensor notch.

And as @rmaddy notes, you can still build with the iOS 11 SDK and deploy back to the less than 10% (and rapidly falling, as of this writing) of iOS devices on iOS 9, just set the Minimum Deployment Target in your Xcode project and make sure that any use of iOS 10 and iOS 11 APIs is guarded by availability checks.

like image 100
rickster Avatar answered Nov 03 '22 01:11

rickster