Menu bar
With macOS Ventura, you can now build MenuBarExtras entirely in SwiftUI!
These can be defined alongside other scene types in your application and will always be shown in the menu bar while your app is running.
import SwiftUI
@main
struct FrenchKit2022App: App {
var body: some Scene {
WindowGroup {
ContentView()
}
Window("Paris c'est aussi la FrenchKit !", id: "Sales") {
ParisDetailsChart()
}
.keyboardShortcut("9")
.defaultPosition(.topLeading)
.defaultSize(width: 420, height: 250)
MenuBarExtra("Conference", systemImage: "lasso.and.sparkles") {
SalesDetailsChart()
Text("Result")
}
.menuBarExtraStyle(.window)
}
}
Last updated