Display Zoom on iPhone Xs Max and Xr question for iOS developers on the forum

To the iOS developers on the forum who have access to an iPhone Xs Max and an Xr - can you please answer this question that I can’t find an answer to anywhere on the web?

I need to know the screen height while Display Zoom is turned on for iPhones Xs Max and Xr. My app depends on a very accurate representation of the screen’s Display Zoom function (found under General > Display & Brightness > Display Zoom), however I can’t find that factor anywhere on the web. It’s only available on those two new phones. Xcode 10.1 simulator doesn’t provide the option for running the app while in Display Zoom and I don’t have access to these physical devices.

If you have an iPhone Xs Max and an Xr can you please post the results of the following code while running in Display Zoom mode on both devices?

print (“Dispaly Zoom screen height: (UIScreen.main.nativeBounds.height)”)

Thanks so much!

I don’t have a XR, but output on my iPhone XS Max is 2688.0 in both cases.

@martijnengler thanks so much for doing this for me. I was able to get my hands on an Xr last night so I could experiment with it myself.
The correct code to run actually is

Print(UIScreen.main.nativeScale)

So, new code. Output in “normal” mode:

Native scale: 3.0
Bounds height: 896.0

Output in zoomed mode:

Native scale: 3.312
Bounds height: 812.0

Code used:

print("Native scale: \(UIScreen.main.nativeScale)")
print("Bounds height: \(UIScreen.main.bounds.height)")
1 Like

@martijnengler thank you so so so much for your help! This is exactly what I needed.

Happy to help! :slight_smile: