Single Unique Window

MacOS

You're likely already familiar with WindowGroup, which is a great way to build the main interface of your app, and can generate multiple windows to allow different perspectives into your app's data.

Window declares a single, unique window for your app.

// Add Window in the Main App files
// choose Mac target

import SwiftUI

@main
struct FrenchKit2022App: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }

        Window("Paris c'est aussi la FrenchKit !", id: "Sales") {
            ParisDetailsChart()
        }
    }
}

Last updated