class Auth{
func auth(){
var currrentUser: String?
}
}
try coordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: url, options:[
NSSQLitePragmasOption: ["journal_mode": "DELETE"],
NSPersistentStoreFileProtectionKey:FileProtectionType.complete] )
let options = [ NSMigratePersistentStoresAutomaticallyOption : true,
NSInferMappingModelAutomaticallyOption : true ]
let options = [ NSSQLitePragmasOption : true,
NSPersistentStoreFileProtectionKey : true,
FileProtectionType.complete: true] as [AnyHashable : Any]
func applectationDocumentsDirectory()->URL{
let documentURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last!
return documentURL
}
lazy var managedObjectModel: NSManagedObjectModel = {
let modelURL = Bundle.main.url(forResource: "App2", withExtension: "momd")!
return NSManagedObjectModel(contentsOf: modelURL)!
}()
lazy var persistentContainer: NSPersistentContainer = {
let fileURL = applectationDocumentsDirectory().appendingPathComponent("App2.sqlite")
var options :[AnyHashable:Any]
options = [AnyHashable("journal_mode":"DELETE"):NSSQLitePragmasOption,AnyHashable(complete):NSPersistentStoreFileProtectionKey]
let container = NSPersistentContainer(name: "App2")
container.persistentStoreCoordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: fileURL, options: <#T##[AnyHashable : Any]?#>)
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()