4

Does anyone know how to build app targeting iOS 11 on Xcode 9 but still have it run in compatibility mode on iPhone X such that it still shows the top and bottom bar borders rather then scale app to fill the screen?

In case this confuses people on the new iPhone X when an old iOS 10 or lower app is run it will run in "Compatibility Mode" which will show a black bar on top and bottom of screen much the way an iPhone app looks on an iPad.

Vlad
  • 5,727
  • 3
  • 38
  • 59
  • Yes I am using a launch xib file for the launch image. But this is general enough question as there may be other ways with/without launch xib/storyboard. – Vlad Sep 15 '17 at 22:45
  • 2
    Why is this downvoted? Xcode 9 breaks a bunch of apps on the iPhone X and although I can use Xcode 8 for now, I'd prefer to set a switch on Xcode 9. – Richard Sep 24 '17 at 17:58
  • 1
    "old iPhone 10 or lower app" Do you mean "old iOS 10 or lower app"? – Zsombor Nov 09 '17 at 14:00

1 Answers1

3

The simplest way to do this it to set static launch images to your project. It's not ideal but I don't know of another way to force compatibility other than building using the iOS 10 as the base SDK.

For those who need some steps setting a static launch image

  1. You can add the static image in your Images.xcassets. Click the + button at the bottom of the xcassets column and select App Icons & Launch Images > New iOS Launch Image. Now add all the static launch images for all the devices that you support apart from the iPhone X.

  2. Now set your project up to use the static launch images instead of a xib file. Select your project root in the folder hierarchy and select the General tab. Scroll down until you get to the App Icons and Launch Images section. Now remove the entry for Launch Screen File and select your new LaunchImage from the dropdown for Launch Images Source.

enter image description here

(Hmm… just spotted a typo in Xcode 9 Launch Images Sourc …anyway)

When you build for the iPhone X, it will see that there are no static launch images for the iPhone X and run it in compatibility mode.

Justyn
  • 1,442
  • 12
  • 27
  • Unfortunately this does not work - Xcode 9 will not copy the launch-images correctly, see https://stackoverflow.com/questions/46263795/iphone-x-incorrect-launch-screen-orientation-used. Can you confirm that? – Hans Knöchel Sep 23 '17 at 21:48
  • 1
    The OP wanted a way here to force compatibility with the iPhone X. So in this answer we don't need to set a static launch image for the iPhone X screen sizes. I can confirm that this is working when not using the iPhone X sized launch images. It forces the iPhone X into compatibility mode with the black top and bottom letter boxing. – Justyn Sep 25 '17 at 07:57