Contents

perRecordCompletionBlock

The closure to execute when a record becomes available.

Declaration

var perRecordCompletionBlock: ((CKRecord?, CKRecord.ID?, (any Error)?) -> Void)? { get set }

Discussion

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

  • The record, or nil if CloudKit can’t retrieve the record.

  • The ID of the record.

  • If CloudKit can’t retrieve the record, an error that provides information about the failure; otherwise, nil.

The fetch operation executes this closure once for each record ID in the recordIDs property. Each time the closure executes, it executes serially with respect to the other progress 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.

See Also

Processing Record Fetch Results