# `GSLayer.rootGroup`

*Instance Property*

A shape group containing all shapes of the layer.

## Declaration

```swift
var rootGroup: GSShapeGroup { get }
```

```objc
@property (readonly) GSShapeGroup * rootGroup;
```

```python
rootGroup() -> GSShapeGroup
```

## Discussion

This is the root of the shape tree structure of the layer. The shapes of this layer are the tree nodes in this hierarchical representation. Other shape groups create nested subtrees.

When processing the shapes of a layer while respecting this shape hierarchy, use this property and a tree traversal algorithm such as the enumeration methods on `GSShapeGroup`. Otherwise, use the `shapes` property for a linear representation of the shapes of the layer.

## See Also

### Shape Groups

- [`GSLayer.shapeGroups`](/Core/GlyphsCore/GSLayer/shapeGroups) — The shape groups keyed by group identifier.
- [`GSLayer reconfigureShapeGroupsSkippingPreconditionCheck:`](/Core/GlyphsCore/GSLayer/reconfigureShapeGroupsSkippingPreconditionCheck:) — Reconfigures the shape groups (setting their member ranges) and reorders `shapes` to match.

