comparison Simoleon/Persistence.swift @ 181:5a9430fd6b4d

restart project to new version
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Wed, 08 Dec 2021 10:52:11 +0100
parents ad8c6567539d
children ba3ebe8cefe5
comparison
equal deleted inserted replaced
180:41f284db0c3d 181:5a9430fd6b4d
1 // 1 //
2 // Persistence.swift 2 // Persistence.swift
3 // Simoleon 3 // simoleon
4 // 4 //
5 // Created by Dennis Concepción Martín on 26/10/21. 5 // Created by Dennis Concepción Martín on 8/12/21.
6 // 6 //
7 7
8 import CoreData 8 import CoreData
9 9
10 struct PersistenceController { 10 struct PersistenceController {
29 }() 29 }()
30 30
31 let container: NSPersistentCloudKitContainer 31 let container: NSPersistentCloudKitContainer
32 32
33 init(inMemory: Bool = false) { 33 init(inMemory: Bool = false) {
34 container = NSPersistentCloudKitContainer(name: "Simoleon") 34 container = NSPersistentCloudKitContainer(name: "simoleon")
35 if inMemory { 35 if inMemory {
36 container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null") 36 container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")
37 } 37 }
38 container.loadPersistentStores(completionHandler: { (storeDescription, error) in 38 container.loadPersistentStores(completionHandler: { (storeDescription, error) in
39 if let error = error as NSError? { 39 if let error = error as NSError? {