discoverAllContactUserInfosWithCompletionHandler 更快?

discoverAllContactUserInfosWithCompletionHandler faster?

如何为 discoverAllContactUserInfosWithCompletionHandler 创建优先级高于默认值的 CKOperation?

我找不到不使用 [[CKContainer defaultContainer] discoverAllContactUserInfosWithCompletionHandler: 查询所有用户信息的示例,它的优先级很低,需要很长时间才能完成。

discoverAllContactUserInfosWithCompletionHandler 的 CloudKit 文档是这样说的:

This method searches for the users asynchronously and with a low priority. If you want the task to execute with a higher priority, create a CKDiscoverAllContactsOperation object and configure the desired priority.

您可以这样设置优先级:

var operation: CKDiscoverAllContactsOperation = CKDiscoverAllContactsOperation()
operation.queuePriority = NSOperationQueuePriority.High

如何使用 CKDiscoverAllContactsOperation 的示例代码可以在这里找到:Any working sample code for CKDiscoverAllContactsOperation for IOS8 beta CloudKit?