<!--
{
  "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/CKRecordNameZoneWideShare",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:@CKRecordNameZoneWideShare"
  },
  "title" : "CKRecordNameZoneWideShare"
}
-->

# CKRecordNameZoneWideShare

The name of a share record that manages a shared record zone.

```
let CKRecordNameZoneWideShare: String
```

## Discussion

When you create an instance of [`CKShare`](/documentation/CloudKit/CKShare) for sharing a record zone, CloudKit automatically assigns this constant as the [`recordName`](/documentation/CloudKit/CKRecord/ID/recordName) element of the share record’s [`recordID`](/documentation/CloudKit/CKRecord/recordID). After you save the share record to iCloud, you can fetch it by reconstructing the record ID using this constant, as the following example shows:

```swift
func fetchShare(
    forZone zone: CKRecordZone,
    completion: @escaping (Result<CKShare, any Error>) -> Void
) {
    let database = CKContainer.default().privateCloudDatabase

    // Use the 'CKRecordNameZoneWideShare' constant to create the record ID.
    let recordID = CKRecord.ID(recordName: CKRecordNameZoneWideShare,
                               zoneID: zone.zoneID)

    // Fetch the share record from the specified record zone.
    database.fetch(withRecordID: recordID) { share, error in
        if let error = error {
            // If the fetch fails, inform the caller.
            completion(.failure(error))
        } else if let share = share as? CKShare {
            // Otherwise, pass the fetched share record to the
            // completion handler.
            completion(.success(share))
        } else {
            fatalError("Unable to fetch record with ID: \(recordID)")
        }
    }
}
```

---

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)