Conditional compile for Vision OS?

using #if os(visionOS) does not work in beta 2, but I have noticed in the simulator that I really need to use thicker lines and darker colors for better legibility. Is there a way to do this in beta 2 yet?

I believe that conditional should work, so please file a bug report if it does not. You can also try #if os(xrOS) in the meantime.

Hi just wanted to let you know that this problem still exists 10 Months later (at least on the simulator). I filed a bug in February but got no feedback yet (FB13589535 (Simulator not recognised as vision OS)). Unfortunately the suggested workaround does not work. When the VisionPro is available in Europe (hopefully later this year?) this problem might get more serious for our products.

Hello, So I think there has been a kind of misunderstanding. I assume @technomage was talking about an app that runs in compatibility mode, so it's not specifically compiled for visionOS. Under these circumstances it is probably expected behaviour to pretend not to be run on visionOS to not break old code that is checking for iOS vs other. I had the chance to test on a real device now and as long as I don't add visionOS as a supported architecture the app will always run in compatibility mode and pretend to be iOS. Since compiling everything for visionOS is not an option right now with multiple dependencies being incompatible we have to resort to a workaround as suggested by https://medium.com/@timonus/low-hanging-fruit-for-ios-apps-running-on-visionos-08a85db0fb31 (I did not test this) or https://stackoverflow.com/a/77962734 (works)

Hello @technomage and @clausInBerlin:

The behavior you've noted is likely due to running a visionOS compatible app. For a native app built with the visionOS SDK, these conditional compilation blocks behave as expected.

I noticed you filed a feedback report, @clausInBerlin — thanks so much. If others encounter this, and would like to see a change in behavior, please consider filing an enhancement request via Feedback Assistant.

Conditional compile for Vision OS?
 
 
Q