#if os(macOS) /// Extract your conditional scene to avoid using `@SceneBuilder` /// In `body`, SwiftUI will always use `@SceneBuilder` to build multiple Scene. /// Because the result type is `some Scene`, /// you just need to return a type that conforms to `Scene` Protocol. funcconditionalWindowScene() -> someScene { if#available(macOS13.0, *) { /// `Window` Scene is only available on macOS 13.0+ returnWindow("App", id: "MAIN") { ContentView() } } else { /// Otherwise, using `WindowGroup` returnWindowGroup { ContentView() } } } #endif }