Contents

perSubscriptionResultBlock

The closure to execute when a subscription becomes available.

Declaration

var perSubscriptionResultBlock: ((CKSubscription.ID, Result<CKSubscription, any Error>) -> Void)? { get set }

Discussion

This property is a closure that returns no value and has the following parameters:

  • The ID of the subscription.

  • A Result that contains either a retrieved subscription, or an error that describes why CloudKit can’t retrieve the subscription.

The fetch operation executes this closure once for each subscription ID in the subscriptionIDs property. Each time the closure executes, it executes serially with respect to the other closures of the operation.

If you intend to use this closure to process results, set it before you execute the operation or submit the operation to a queue.