Contents

fetchDatabaseChangesCompletionBlock

The closure to execute when the operation finishes.

Declaration

var fetchDatabaseChangesCompletionBlock: ((CKServerChangeToken?, Bool, (any Error)?) -> Void)? { get set }

Discussion

The closure returns no value and takes the following parameters:

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

  • A Boolen value that indicates whether this is the final database change. If fetchAllChanges is false, it’s the app’s responsibility to create additional instances of CKFetchDatabaseChangesOperation to fetch further changes.

  • An error object that contains information about a problem, or nil if CloudKit successfully retrieves the database changes.

Your app is responsible for saving the change token at the end of the operation and providing it to future uses of CKFetchDatabaseChangesOperation. If the server returns a CKError.Code.changeTokenExpired error, the previousServerChangeToken value is stale and your app needs to clear its local cache and refetch the database changes, starting with a nil change token.

See Also

Processing the Operation’s Results