Skip to content

Instantly share code, notes, and snippets.

View devsandeshnaik's full-sized avatar

Sandesh Naik devsandeshnaik

  • Pune, India
View GitHub Profile
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")