Post

Replies

Boosts

Views

Activity

How to target SwiftUI code to only the visionOS platform (Compiler Directive)
I am trying to do the following code: func withBackground() -> some View { #if os(visionOS) background { Material.thin } #else background { Color.offWhite.ignoresSafeArea() } #endif } But Xcode 15 Beta 2 says the following: Unknown operating system for build configuration os How can I change the background ONLY for visionOS, while keeping it as is on the other platforms I support? Thanks!
2
2
1.2k
Jun ’23