<!--
{
  "availability" : [
    "iOS: 8.0.0 - 15.0.0",
    "iPadOS: 8.0.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "macOS: 10.10.0 - 12.0.0",
    "tvOS: 9.0.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 8.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKModifyRecordsOperation/perRecordCompletionBlock",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKModifyRecordsOperation(py)perRecordCompletionBlock"
  },
  "title" : "perRecordCompletionBlock"
}
-->

# perRecordCompletionBlock

The closure to execute when CloudKit saves a record.

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

## Discussion

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

- The record that CloudKit saves.
- If CloudKit can’t save the record, an error that provides information about the failure; otherwise, `nil`.

The closure executes once for each record in the [`recordsToSave`](/documentation/CloudKit/CKModifyRecordsOperation/recordsToSave) property. Each time the closure executes, it executes serially with respect to the other record completion blocks 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.

---

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)