<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKFetchRecordZoneChangesOperation/recordWasChangedBlock-x5bw",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So33CKFetchRecordZoneChangesOperationC8CloudKitE21recordWasChangedBlockySo10CKRecordIDC_s6ResultOySo0L0Cs5Error_pGtcSgvp"
  },
  "title" : "recordWasChangedBlock"
}
-->

# recordWasChangedBlock

The closure to execute with the results of retrieving a record change.

```
var recordWasChangedBlock: ((CKRecord.ID, Result<CKRecord, any Error>) -> Void)? { get set }
```

## Discussion

The closure returns no value and takes the following parameters:

- A <doc://com.apple.documentation/documentation/Swift/Result> that contains either:
  - The changed record.
    If you specify a value for the [`desiredKeys`](/documentation/CloudKit/CKFetchRecordZoneChangesOperation/ZoneConfiguration/desiredKeys) property, the record contains only the corresponding fields.
  - An error that contains information about a problem encountered retrieving the changed record.

The operation executes this closure once for each record in the record zone with changes since the previous fetch request. Each time the closure executes, it executes serially with respect to the other closures of the operation. If there aren’t any record changes, this closure doesn’t execute.

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)