<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKShare/init(recordZoneID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKShare(im)initWithRecordZoneID:"
  },
  "title" : "init(recordZoneID:)"
}
-->

# init(recordZoneID:)

Creates a new share for the specified record zone.

```
init(recordZoneID: CKRecordZone.ID)
```

## Parameters

`recordZoneID`

The ID of the record zone to share.

## Discussion

A shared record zone must have the [`zoneWideSharing`](/documentation/CloudKit/CKRecordZone/Capabilities-swift.struct/zoneWideSharing) capability. Custom record zones that you create in the user’s private database have this capability by default. A record zone, and the records it contains, can take part in only a single share.

After accepting a share invite, CloudKit adds the records of the shared record zone to a new zone in the participant’s shared database. Use [`CKFetchDatabaseChangesOperation`](/documentation/CloudKit/CKFetchDatabaseChangesOperation) to fetch the ID of the new record zone. Then configure [`CKFetchRecordZoneChangesOperation`](/documentation/CloudKit/CKFetchRecordZoneChangesOperation) with that record zone ID and execute the operation to fetch the records.

If you use [`CKFetchShareMetadataOperation`](/documentation/CloudKit/CKFetchShareMetadataOperation) to fetch the metadata for a shared record zone, the operation ignores the [`shouldFetchRootRecord`](/documentation/CloudKit/CKFetchShareMetadataOperation/shouldFetchRootRecord) and [`rootRecordDesiredKeys`](/documentation/CloudKit/CKFetchShareMetadataOperation/rootRecordDesiredKeys-3xrex) properties because, unlike a shared record hierarchy, a record zone doesn’t have a nominated root record.

---

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)