πŸ”ͺ
Cutting-Edge SwiftUI Apps
  • πŸ“³Cutting-Edge SwiftUI Apps
  • TUTORIALS AND TIPS
    • πŸ‘‹Introduction
  • ▢️Start with Charts
    • πŸ‘©β€πŸ’»Necessary Installations
    • Bar Mark
      • Chart Data driven
      • Xcode
    • Design as a time series
      • Bar graph
      • More data
      • Multi-series Line chart
  • ▢️New Window
    • πŸ‘©β€πŸ’»Necessary Installations
    • Single Unique Window
    • Menu bar
  • ▢️New Sharing
    • πŸ‘©β€πŸ’»Necessary Installations
    • ShareLink API
  • ▢️Start with Layout
    • Grid
  • WRAPPING IT UP
  • πŸ€Έβ€β™€οΈAuthor
  • πŸ“–References
Powered by GitBook
On this page
  1. New Window

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)

}

}

import SwiftUI

@main
struct FrenchKit2022App: App {
    var body: some Scene {
        MenuBarExtra("Conference", systemImage: "lasso.and.sparkles") {
            SalesDetailsChart()
            Text("Result")
        }
        .menuBarExtraStyle(.window)
    }
}

PreviousSingle Unique WindowNextNew Sharing

Last updated 2 years ago

▢️