Implemented the "container" property for the PiperApp app in the app target.
This commit is contained in:
parent
e00c7f810f
commit
37da844938
@ -14,16 +14,14 @@ struct PiperApp: App {
|
|||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
var sharedModelContainer: ModelContainer = {
|
private var container = {
|
||||||
let schema = Schema([
|
|
||||||
Item.self,
|
|
||||||
])
|
|
||||||
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
return try ModelContainer(for: schema, configurations: [modelConfiguration])
|
return try ModelContainer(
|
||||||
|
for: .entities,
|
||||||
|
configurations: [ModelConfiguration()]
|
||||||
|
)
|
||||||
} catch {
|
} catch {
|
||||||
fatalError("Could not create ModelContainer: \(error)")
|
fatalError("ERROR: ModelContainer has not been created => \(error)")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user