Post not yet marked as solved
Post marked as unsolved with 1 replies, 609 views
I’ve got a Mac app with different kinds of windows. However, only Window1 is created on launch:
import SwiftUI
@main struct MyApp: App {
@SceneBuilder var body: some Scene {
Window1()
Window2()
}
}
struct Window1: Scene {
var body: some Scene {
WindowGroup {
Text("Window 1")
.padding(100)
.navigationTitle("Title 1")
}
}
}
struct Window2: Scene {
var body: some Scene {
WindowGroup {
Text("Window 2")
.padding(100)
.navigationTitle("Title 2")
}
}
}
How do we create a Window2? Is this even possible? Documentation is not clear in this regard.
By the way, we have Settings window group on macOS. How does it work?