2022-01-29 18:59:42 +01:00
|
|
|
import SwiftUI
|
2023-12-12 17:33:42 +01:00
|
|
|
import SwiftData
|
2022-01-29 18:59:42 +01:00
|
|
|
|
|
|
|
@main
|
|
|
|
struct SesameApp: App {
|
2023-12-12 17:33:42 +01:00
|
|
|
|
|
|
|
@State
|
|
|
|
var modelContainer: ModelContainer
|
|
|
|
|
|
|
|
init() {
|
|
|
|
do {
|
|
|
|
self.modelContainer = try ModelContainer(for: HistoryItem.self)
|
|
|
|
} catch {
|
|
|
|
fatalError("Failed to create model container: \(error)")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-29 18:59:42 +01:00
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
2023-12-12 17:33:42 +01:00
|
|
|
ContentView(modelContext: modelContainer.mainContext)
|
2022-01-29 18:59:42 +01:00
|
|
|
}
|
2023-12-12 17:33:42 +01:00
|
|
|
.modelContainer(modelContainer)
|
2022-01-29 18:59:42 +01:00
|
|
|
}
|
|
|
|
}
|