<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKDatabase/recordZones(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So10CKDatabaseC8CloudKitE11recordZones3forSDySo14CKRecordZoneIDCs6ResultOySo0gH0Cs5Error_pGGSayAGG_tYaKF"
  },
  "title" : "recordZones(for:)"
}
-->

# recordZones(for:)

Fetches the specified record zones and returns them to an awaiting caller.

```
func recordZones(for ids: [CKRecordZone.ID]) async throws -> [CKRecordZone.ID : Result<CKRecordZone, any Error>]
```

## Parameters

`ids`

The identifiers of the record zones to fetch.

## Return Value

A dictionary that contains the fetched record zones. The dictionary uses the specified record zone identifiers as its keys. The value of each key is a <doc://com.apple.documentation/documentation/Swift/Result> that contains either the corresponding fetched record zone, or an error that describes why CloudKit can’t provide that record zone.

## Discussion

This method throws an error if the request fails, such as when the network is unavailable or the device doesn’t have an active iCloud account; otherwise, the returned dictionary includes any individual record zone errors.

For information on a more configurable way to fetch specific record zones, see [`CKFetchRecordZonesOperation`](/documentation/CloudKit/CKFetchRecordZonesOperation).

---

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)