This PR contains the work done to implement a very basic menu bar UI layout where to build the app. In addition, the .gitignore and the README file have been added to the project. Reviewed-on: #2 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
55 lines
1.2 KiB
Swift
55 lines
1.2 KiB
Swift
//
|
|
// PiperApp.swift
|
|
// Piper ~ App
|
|
//
|
|
// Created by Javier Cicchelli on 04/10/2024.
|
|
// Copyright © 2024 Röck+Cöde. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
import SwiftData
|
|
|
|
@main
|
|
struct PiperApp: App {
|
|
|
|
// MARK: Properties
|
|
|
|
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
|
|
|
|
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")
|
|
}
|
|
.menuBarExtraStyle(.window)
|
|
}
|
|
|
|
}
|