From 1d9d2e5ce1c5fe4ca9e0ff3c87e2765a18647cc8 Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 9 Mar 2023 17:42:51 +0100 Subject: [PATCH] Fixes cloudkit issues --- LeCountdown/LeCountdownApp.swift | 11 +++++++++++ LeCountdown/Model/Persistence.swift | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/LeCountdown/LeCountdownApp.swift b/LeCountdown/LeCountdownApp.swift index 1d7dff2..642b6df 100644 --- a/LeCountdown/LeCountdownApp.swift +++ b/LeCountdown/LeCountdownApp.swift @@ -25,6 +25,17 @@ struct LeCountdownApp: App { UIPageControl.appearance().pageIndicatorTintColor = UIColor(white: 0.7, alpha: 1.0) self._registerBackgroundRefreshes() + self._initSchema() + + } + + fileprivate func _initSchema() { + + do { + try persistenceController.container.initializeCloudKitSchema() + } catch { + print("ERROR \(error)") + } } diff --git a/LeCountdown/Model/Persistence.swift b/LeCountdown/Model/Persistence.swift index d1730ca..5b8c7ac 100644 --- a/LeCountdown/Model/Persistence.swift +++ b/LeCountdown/Model/Persistence.swift @@ -65,8 +65,8 @@ struct PersistenceController { let options = NSPersistentCloudKitContainerOptions(containerIdentifier: id) storeDescription.cloudKitContainerOptions = options - let remoteChangeKey = "NSPersistentStoreRemoteChangeNotificationOptionKey" - storeDescription.setOption(true as NSNumber, forKey: remoteChangeKey) +// let remoteChangeKey = "NSPersistentStoreRemoteChangeNotificationOptionKey" +// storeDescription.setOption(true as NSNumber, forKey: remoteChangeKey) container = NSPersistentCloudKitContainer(name: "LeCountdown") container.persistentStoreDescriptions = [storeDescription]