Hello,
When an iOS app runs on Vision Pro in compatible mode, is there a flag such as isiOSAppOnVision
to determine the underlying OS at runtime? Just like the ProcessInfo.isiOSAppOnMac
. It will be useful to optimize the app for visionOS.
Already checked but not useful:
#if os(xrOS)
does not work in compatible mode since no code is recompiled.UIDevice.userInterfaceIdiom
returns.pad
instead of.reality
.
Thanks.
It looks like iOS 26.1 introduces a legitimate API to detect this https://developer.apple.com/documentation/foundation/processinfo/isiosapponvision