diff --git a/CubeTime/Persistence.swift b/CubeTime/Persistence.swift index 21cfb61..af0064d 100644 --- a/CubeTime/Persistence.swift +++ b/CubeTime/Persistence.swift @@ -25,8 +25,15 @@ struct PersistenceController { container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null") } else { container = NSPersistentCloudKitContainer(name: "txmerdata") + + let description = container.persistentStoreDescriptions.first! + description.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions( + containerIdentifier: "iCloud.com.cubetime.cubetime" + ) + description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) + description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey) } - + container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately.