---
title: "recordZoneChanges(inZoneWith:since:desiredKeys:resultsLimit:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/recordzonechanges(inzonewith:since:desiredkeys:resultslimit:)"
---

# recordZoneChanges(inZoneWith:since:desiredKeys:resultsLimit:)

Fetches all modified records from a specific record zone and returns them to an awaiting caller.

## Declaration

```swift
func recordZoneChanges(inZoneWith zoneID: CKRecordZone.ID, since changeToken: CKServerChangeToken?, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int? = nil) async throws -> (modificationResultsByID: [CKRecord.ID : Result<CKDatabase.RecordZoneChange.Modification, any Error>], deletions: [CKDatabase.RecordZoneChange.Deletion], changeToken: CKServerChangeToken, moreComing: Bool)
```

## Parameters

- `zoneID`: The identifier of the record zone with changes.
- `changeToken`: The change token from the previous execution of this method. If this is your app’s first fetch, or you want to refetch every change in the record zone’s history, specify nil.
- `desiredKeys`: The fields to include on each fetched record. To include all fields, specify nil; to fetch only system fields, specify an empty array.
- `resultsLimit`: The maximum number of changes to return. The server may use a limit lower than this value.

## Return Value

Return Value A tuple with the following named elements:

## Discussion

Discussion This method fetches record changes in the specfied record zone, such as those that occur during record creation, modification, and deletion. It throws an error if the request fails, such as when the network is unavailable or the device doesn’t have an active iCloud account; otherwise, the returned tuple includes any individual record errors. Along with the fetched changes, CloudKit supplies a change token, which is an opaque token that denotes a specific point in the record zone’s history. Store this token and provide it the next time you execute this method. Change tokens conform to NSSecureCoding and are safe to cache on-disk. Don’t infer any behavior or order from a token’s contents. For information on a more configurable way to fetch record zone changes, see CKFetchRecordZoneChangesOperation.

## See Also

### Fetching Changes

- [databaseChanges(since:resultsLimit:)](cloudkit/ckdatabase/databasechanges(since:resultslimit:).md)
- [fetchDatabaseChanges(since:resultsLimit:completionHandler:)](cloudkit/ckdatabase/fetchdatabasechanges(since:resultslimit:completionhandler:).md)
- [CKDatabase.DatabaseChange](cloudkit/ckdatabase/databasechange.md)
- [fetchRecordZoneChanges(inZoneWith:since:desiredKeys:resultsLimit:completionHandler:)](cloudkit/ckdatabase/fetchrecordzonechanges(inzonewith:since:desiredkeys:resultslimit:completionhandler:).md)
- [CKDatabase.RecordZoneChange](cloudkit/ckdatabase/recordzonechange.md)
