piper-app/Piper/Sources/Previews/Extensions/ModelContainer+Constants.swift

27 lines
567 B
Swift
Raw Normal View History

//
// ModelContainer+Constants.swift
// Piper
//
// Created by Javier Cicchelli on 06/10/2024.
// Copyright © 2024 Röck+Cöde. All rights reserved.
//
import SwiftData
extension ModelContainer {
// MARK: Constants
static let preview: ModelContainer = {
do {
return try ModelContainer(
for: .entities,
configurations: ModelConfiguration(isStoredInMemoryOnly: true)
)
} catch {
fatalError("Model Container should have been created.")
}
}()
}