Swipe-That_pic/Swipe That Pic/Swipe_That_PicApp.swift
2024-07-30 14:46:56 +02:00

35 lines
811 B
Swift

//
// Swipe_That_PicApp.swift
// Swipe That Pic
//
// Created by Amine Bou on 26/07/2024.
//
import SwiftUI
import SwiftData
import Photos
@main
struct Swipe_That_PicApp: App {
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)")
}
}()
var body: some Scene {
WindowGroup {
ContentView().environmentObject(PhotosService(modelContainer: sharedModelContainer))
}
.modelContainer(sharedModelContainer)
}
}