---
title: "init(recordIDs:)"
framework: cloudkit
role: symbol
role_heading: Initializer
path: "cloudkit/ckfetchrecordsoperation/init(recordids:)"
---

# init(recordIDs:)

Creates a fetch operation for retrieving the records with the specified IDs.

## Declaration

```swift
convenience init(recordIDs: [CKRecord.ID])
```

## Parameters

- `recordIDs`: An array of doc://com.apple.cloudkit/documentation/CloudKit/CKRecord/ID objects that represents the records you want to retrieve. If you provide an empty array, you must set the doc://com.apple.cloudkit/documentation/CloudKit/CKFetchRecordsOperation/recordIDs property before you execute the operation.

## Discussion

Discussion A fetch operation retrieves all of a record’s fields, including any assets that those fields reference. If you want to minimize the amount of data that the operation returns, configure the desiredKeys property with only the keys that contain the values that you have an interest in. After initializing the operation, you must associate at least one progress handler with the operation (excluding the completion handler) to process the results.

## See Also

### Creating a Record Fetch Operation

- [init()](cloudkit/ckfetchrecordsoperation/init().md)
