From 3c763595acabbd1f010b7e79b829689c70e52543 Mon Sep 17 00:00:00 2001 From: Firdavs Murodov Date: Mon, 6 Apr 2026 10:28:26 +0200 Subject: [PATCH] fix: Configure CloudKit container options for iCloud sync --- CubeTime/Persistence.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CubeTime/Persistence.swift b/CubeTime/Persistence.swift index 21cfb613..af0064df 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.