<!--
{
  "availability" : [
    "iOS: 10.0.0 - 16.0.0",
    "iPadOS: 10.0.0 - 16.0.0",
    "macCatalyst: 13.1.0 - 16.0.0",
    "macOS: 10.12.0 - 13.0.0",
    "tvOS: 10.0.0 - 16.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 9.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKShare/Metadata/rootRecordID",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKShareMetadata(py)rootRecordID"
  },
  "title" : "rootRecordID"
}
-->

# rootRecordID

The record ID of the share’s root record.

```
@NSCopying var rootRecordID: CKRecord.ID { get }
```

## Discussion

CloudKit populates this property only for metadata that belongs to a shared record hierarchy. If the metadata is part of a shared record zone, the property returns `nil`. This is because, unlike a shared record hierarchy, a shared 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)