UIScreen.screens.count differs on iPhone Duo sims depending on if app is IOS 26 SDK, or iOS 27 SDK

Hi there,

My app uses UIScreen.screens.count (deprecated) to predict whether mirroring is happening on older iOS devices

I noticed that the number of screens is different between iOS 26 SDK apps, and iOS 27 SDK apps.

Can I expect that iOS 26 SDK apps will continue to return 1 screen like below for the iPhone Duo release?. I assume it's like this is to maximise compatibility.


App built with SDK 26 on Xcode 27.1b1 iPhone Duo sim:

UIScreen.screens.count == 1

App built with SDK 27 on Xcode 27.1b1 iPhone Duo sim:

UIScreen.screens.count == 2

Thanks for the help! Sam

Answered by Frameworks Engineer in 908343022

You should use UITraitCollection.sceneCaptureState to determine if your content is being mirrored. This works back to iOS 17.

You should use UITraitCollection.sceneCaptureState to determine if your content is being mirrored. This works back to iOS 17.

Hey, thanks for the information.

I'll take a look at this for iOS17+. I currently have minimum support set to iOS 15+, so will have to look at alternate solutions for those iOS's.

In terms of that specific UIScreen API, can I expect it to continue to return 1 screen on the Duo if my app is built with iOS 26 SDKs for the near future?

Thanks!

Accepted Answer

For pre-iOS 17 support you can check if the screen your view is on is captured – view.window.screen.captured.

I would expect that if you're seeing differences in behavior between linking against iOS 26 vs iOS 27 when running on Duo, that would continue to see those differences, but I cannot guarantee that.

Thanks for the information. That's helpful.