| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // TodosApp.swift
- // Todos
- //
- // Created by Sam Jaffe on 2/28/26.
- //
- import SwiftUI
- import SwiftData
- struct UserDefaultsKeys {
- private static let root = "leumasjaffe.Todos"
- static let UrlHints = root + ".URLHints"
- static let WeekStart = root + ".WeekStart"
- }
- @main
- struct TodosApp: App {
- var sharedModelContainer: ModelContainer = {
- let schema = Schema([
- Category.self,
- ])
- let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
- do {
- return try ModelContainer(for: schema, configurations: [modelConfiguration])
- } catch {
- fatalError("Could not create ModelContainer: \(error)")
- }
- }()
- var body: some Scene {
- WindowGroup {
- ContentView()
- }
- .modelContainer(sharedModelContainer)
- .commands {
- CommandGroup(replacing: .newItem) {
- SaveSnapshotMenu()
- .modelContainer(sharedModelContainer)
- ExportMenu()
- .modelContainer(sharedModelContainer)
- }
- }
-
- #if os(macOS)
- Settings {
- SettingsView()
- }
- #endif
- }
- }
|