---
title: "delete(withRecordID:completionHandler:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/delete(withrecordid:completionhandler:)"
---

# delete(withRecordID:completionHandler:)

Deletes a specific record.

## Declaration

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

```swift
func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID
```

## Parameters

- `recordID`: The identifier of the record to delete.
- `completionHandler`: The closure to execute after CloudKit deletes the record.

## Discussion

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:).

## See Also

### Modifying Records

- [modifyRecords(saving:deleting:savePolicy:atomically:)](cloudkit/ckdatabase/modifyrecords(saving:deleting:savepolicy:atomically:).md)
- [modifyRecords(saving:deleting:savePolicy:atomically:completionHandler:)](cloudkit/ckdatabase/modifyrecords(saving:deleting:savepolicy:atomically:completionhandler:).md)
- [CKModifyRecordsOperation.RecordSavePolicy](cloudkit/ckmodifyrecordsoperation/recordsavepolicy.md)
- [save(_:completionHandler:)](cloudkit/ckdatabase/save(_:completionhandler:)-3tatz.md)
