This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreData | |
struct PersitentContainer { | |
static let shared = PersitentContainer(modelName: "your-model-name") | |
init(modelName: String) { | |
let persistanceContainer = NSPersistentContainer(name: modelName) | |
persistanceContainer.loadPersistentStores { storeDescription, error in | |
guard error == nil else { fatalError(error!.localizedDescription) } | |
print("Store configured successfully") |