<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKDatabase/delete(withRecordID:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKDatabase(im)deleteRecordWithID:completionHandler:"
  },
  "title" : "delete(withRecordID:completionHandler:)"
}
-->

# delete(withRecordID:completionHandler:)

Deletes a specific record.

```
func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping @Sendable (CKRecord.ID?, (any Error)?) -> Void)
```

## Parameters

`recordID`

The identifier of the record to delete.

`completionHandler`

The closure to execute after CloudKit deletes the record.

## Discussion

The completion handler takes the following parameters:

- The identifier of the deleted record, or `nil` if there’s an error.
- An error if a problem occurs, or `nil` if CloudKit successfully deletes the record.

Deleting a record may cause additional deletions if other records in the database reference the deleted record. CloudKit doesn’t provide the identifiers of any additional records it deletes.

For information on a more convenient way to delete records, see [`modifyRecords(saving:deleting:savePolicy:atomically:)`](/documentation/CloudKit/CKDatabase/modifyRecords(saving:deleting:savePolicy:atomically:)).

---

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)