cloudkit

Core data + CloudKit - sharing between iOS and watchOS companion app

末鹿安然 提交于 2020-12-29 06:54:27
问题 In my app I store data with core data. Recently I discovered the new feature introduced by Apple in WWDC19 which allows core data to work with CloudKit. I just enabled cloudKit for my app and used an NSPersistentCloudKitContainer instead of NSPersistentContainer and all was set up ! All my data is shared between ios devices. That works like NSPersistentContainer but it sends a copy of changes on icloud server, so there is always a local cache of data. Now I'd like to access that data from my

NSPersistentCloudKitContainer: How to check if data is synced to CloudKit

末鹿安然 提交于 2020-12-27 08:39:05
问题 I have implemented NSPersistentCloudKitContainer to get my data synced to CloudKit , I would like to know that the sync is finished and there is no other change pending to be synced. When I tried reinstalling the app, I start getting my data back from CloudKit and it started printing certain logs in the console. It takes around 30 seconds to get all my data back from the CloudKit. Some of the logs mention about NSCloudKitMirroringDelegate . It looks like NSCloudKitMirroringDelegate knows

How do I force iCloud to sync data of an App on fresh install / first launch?

隐身守侯 提交于 2020-12-15 06:03:51
问题 In a game I am working on I have implemented GKSavedGames and everything is working correctly except that if the game is uninstalled and reinstalled or installed on a new device the first initial launch fetchSavedGamesWithCompletionHandler returns 0 saved games. Is there a way to force iCloud to sync the files to the device? I have tried waiting and recalling fetchSavedGamesWithCompletionHandler but nothing seems to work. If I immediately relaunch the app all the save files are then available