35 lines
811 B
Swift
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)
|
||
|
}
|
||
|
}
|