fetchSubscriptionCompletionBlock
The block to execute after the operation fetches the subscriptions.
Declaration
@property (nonatomic, copy) void (^fetchSubscriptionCompletionBlock)(NSDictionary<NSString *,CKSubscription *> *subscriptionsBySubscriptionID, NSError *operationError);Discussion
The block returns no value and takes the following parameters:
subscriptionsBySubscriptionIDA dictionary with keys that are the IDs of the subscriptions you request, and values that are the corresponding subscriptions.
operationErrorAn error that contains information about a problem, or
nilif the system successfully fetches the subscriptions.
The operation executes this block only once, and it’s your only opportunity to process the results. The block executes on a background queue, so any tasks that require access to the main queue must dispatch accordingly.
The block reports an error of type CKError.Code.partialFailure when it retrieves only some of the subscriptions successfully. The userInfo dictionary of the error contains a CKPartialErrorsByItemIDKey key that has a dictionary as its value. The keys of the dictionary are the IDs of the subscriptions that the operation can’t fetch, and the corresponding values are errors that contain information about the failures.
Set this property’s value before you execute the operation or submit it to a queue.