如何检测所有 CloudKit 更新何时发生?

How to detect when all CloudKit Updates happened?

在我的代码中,我使用 func fetchDatabaseChanges func fetchZoneChanges Apple Documentation

中描述的方法

我需要在 CloudKit 记录的所有提取和更改发生后发送通知。我不清楚我应该把这个电话放在哪里?

operation.recordZoneFetchCompletionBlock或者可能在operation.recordChangedBlock

此发送通知调用应该在所有更新发生后发生。

您可以在此处的文档中找到答案。

https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/CloudKitQuickStart/SubscribingtoRecordChanges/SubscribingtoRecordChanges.html

简而言之,您设置了对 cloudKit 代码的订阅,然后通过 appDelegate 注册以获取远程通知。而不是最终设置代码来处理它们。