fetch(withRecordID:completionHandler:)
Fetches a specific record.
Declaration
func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping @Sendable (CKRecord?, (any Error)?) -> Void)func record(for recordID: CKRecord.ID) async throws -> CKRecordParameters
- recordID:
The identifier of the record to fetch.
- completionHandler:
The closure to execute with the fetch results.
Discussion
The completion handler takes the following parameters:
The requested record, or
nilif CloudKit can’t provide that record.An error if a problem occurs, or
nilif the fetch completes successfully.
For information on a more convenient way to fetch specific records, see records(for:desiredKeys:).