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

55 lines
1.2 KiB
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
2024-10-04 20:43:37 +02:00
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Item.self,
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
do {
return try ModelContainer(for: schema, configurations: [modelConfiguration])
} catch {
fatalError("Could not create ModelContainer: \(error)")
}
}()
// MARK: Body
2024-10-04 20:43:37 +02:00
var body: some Scene {
MenuBarExtra {
VStack(alignment: .leading) {
Text("Some text goes here...")
.foregroundStyle(.primary)
Divider()
Button {
// ...
} label: {
Text("Some text goes here...")
.frame(maxWidth: .infinity)
}
}
.padding()
} 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
}