Replaced the main window for the PiperApp app in the Piper target with a menu bar.

This commit is contained in:
Javier Cicchelli 2024-10-04 23:23:57 +02:00
parent fc974787e8
commit a2d46fc0ea

View File

@ -11,6 +11,9 @@ import SwiftData
@main @main
struct PiperApp: App { struct PiperApp: App {
// MARK: Properties
var sharedModelContainer: ModelContainer = { var sharedModelContainer: ModelContainer = {
let schema = Schema([ let schema = Schema([
Item.self, Item.self,
@ -23,11 +26,15 @@ struct PiperApp: App {
fatalError("Could not create ModelContainer: \(error)") fatalError("Could not create ModelContainer: \(error)")
} }
}() }()
// MARK: Body
var body: some Scene { var body: some Scene {
WindowGroup { MenuBarExtra {
ContentView() EmptyView()
} label: {
Image(systemName: "circle.fill")
} }
.modelContainer(sharedModelContainer)
} }
} }