This PR contains the work done to open the *Settings* view and also, implemented the rendering of its tab items. Reviewed-on: #5 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
45 lines
867 B
Swift
45 lines
867 B
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
|
|
|
|
private var container = {
|
|
do {
|
|
return try ModelContainer(
|
|
for: .entities,
|
|
configurations: [ModelConfiguration()]
|
|
)
|
|
} catch {
|
|
fatalError("ERROR: ModelContainer has not been created => \(error)")
|
|
}
|
|
}()
|
|
|
|
// MARK: Body
|
|
|
|
var body: some Scene {
|
|
MenuBarExtra {
|
|
MenuBarView()
|
|
.modelContainer(container)
|
|
} label: {
|
|
Image(systemName: "circle.fill")
|
|
}
|
|
.menuBarExtraStyle(.window)
|
|
|
|
Settings {
|
|
SettingsView()
|
|
}
|
|
}
|
|
|
|
}
|