piper-app/Piper/Sources/App/PiperApp.swift

41 lines
802 B
Swift
Raw Normal View History

2024-10-04 20:43:37 +02:00
//
// PiperApp.swift
// Piper ~ App
2024-10-04 20:43:37 +02:00
//
// Created by Javier Cicchelli on 04/10/2024.
// Copyright © 2024 Röck+Cöde. All rights reserved.
2024-10-04 20:43:37 +02:00
//
import SwiftUI
import SwiftData
@main
struct PiperApp: App {
// MARK: Properties
private var container = {
2024-10-04 20:43:37 +02:00
do {
return try ModelContainer(
for: .entities,
configurations: [ModelConfiguration()]
)
2024-10-04 20:43:37 +02:00
} catch {
fatalError("ERROR: ModelContainer has not been created => \(error)")
2024-10-04 20:43:37 +02:00
}
}()
// MARK: Body
2024-10-04 20:43:37 +02:00
var body: some Scene {
MenuBarExtra {
MenuBarView()
.modelContainer(container)
} label: {
Image(systemName: "circle.fill")
2024-10-04 20:43:37 +02:00
}
.menuBarExtraStyle(.window)
2024-10-04 20:43:37 +02:00
}
2024-10-04 20:43:37 +02:00
}