---
title: rootRecordID
framework: cloudkit
role: symbol
role_heading: Instance Property
path: cloudkit/ckshare/metadata/rootrecordid
---

# rootRecordID

The record ID of the share’s root record.

## Declaration

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

## Discussion

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.

## See Also

### Accessing the Root Record

- [hierarchicalRootRecordID](cloudkit/ckshare/metadata/hierarchicalrootrecordid.md)
- [rootRecord](cloudkit/ckshare/metadata/rootrecord.md)
