I have the following code in Objective-C:
if (@available(iOS 13.0, tvOS 13.0, *)) {
indicator.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleLarge;
} else {
indicator.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
}
But this is producing an error.
'UIActivityIndicatorViewStyleWhiteLarge' is unavailable: not available on xrOS
I think I need that first conditional to get run so it doesn't even try to access UIActivityIndicatorViewStyleWhiteLarge
.
But when I change the line to if (@available(iOS 13.0, tvOS 13.0, visionOS 1.0, *))
. I get the following error:
Unrecognized platform name visionOS
I also tried changing it to xrOS 1.0
(since I heard that some internal usages had it as xrOS for a while. And while I don't get the second compiler error, it does still say it's unavailable.
Any ideas on how to fix this?
Use TARGET_OS_VISION
to distinguish RealityKit only targets:
#if TARGET_OS_VISION
#else
#endif // TARGET_OS_VISION
Use TARGET_OS_VISION
#if TARGET_OS_VISION
#else
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With