Contents

recordZoneFetchResultBlock

The closure to execute when a record zone’s fetch finishes.

Declaration

var recordZoneFetchResultBlock: ((CKRecordZone.ID, Result<(serverChangeToken: CKServerChangeToken, clientChangeTokenData: Data?, moreComing: Bool), any Error>) -> Void)? { get set }

Discussion

The closure returns no value and takes the following parameters:

recordZoneID

The record zone’s ID.

fetchChangesResult

A Result that contains either:

  • A successful Result of

    • The change token to store and use in subsequent instances of CKFetchRecordZoneChangesOperation.

    • The more recent client change token from the device. If the change token isn’t the more recent change token you provided, the server might not have received the associated changes.

    • A Boolean that indicates whether this is the final record zone change. If fetchAllChanges is false, it’s the app’s responsibility to create additional instances of CKFetchRecordZoneChangesOperation to fetch further changes.

  • An error object that contains information about a problem encountered retrieving the record zone changes.

The app is responsible for saving the change token at the end of the operation and providing it to future uses of CKFetchRecordZoneChangesOperation. Each time the closure executes, it executes serially with respect to the other closures of the operation.

Set this property before you execute the operation or submit it to a queue.