---
title: "fetchAllRecordZones(completionHandler:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/fetchallrecordzones(completionhandler:)"
---

# fetchAllRecordZones(completionHandler:)

Fetches all record zones from the current database.

## Declaration

```swift
func fetchAllRecordZones(completionHandler: @escaping @Sendable ([CKRecordZone]?, (any Error)?) -> Void)
```

## Parameters

- `completionHandler`: The closure to execute with the fetch results.

## Discussion

Discussion The completion handler takes the following parameters: An array of fetched record zones, or nil if there’s an error. When present, the array contains at least one record zone, the default zone. An error if a problem occurs, or nil if CloudKit successfully fetches all record zones.

## See Also

### Fetching Record Zones

- [recordZones(for:)](cloudkit/ckdatabase/recordzones(for:).md)
- [fetch(withRecordZoneIDs:completionHandler:)](cloudkit/ckdatabase/fetch(withrecordzoneids:completionhandler:).md)
- [fetch(withRecordZoneID:completionHandler:)](cloudkit/ckdatabase/fetch(withrecordzoneid:completionhandler:).md)
