# `GSShape.parentGroup`

*Instance Property*

The direct containing group in the layer’s shape hierarchy.

## Declaration

```swift
var parentGroup: GSShapeGroup? { get }
```

```objc
@property (nonatomic, readonly) GSShapeGroup * parentGroup;
```

```python
parentGroup() -> GSShapeGroup
```

## Discussion

An ungrouped shape in a layer belongs to the layer’s root group. The value is `nil` when the shape does not belong to a layer or its parent group cannot be resolved.

## See Also

### Shape Hierarchy

- [`GSShape.parentGroupId`](/Core/GlyphsCore/GSShape/parentGroupId) — The ID of the parent group.
- [`GSShape enumerateParentGroupsWithBlock:`](/Core/GlyphsCore/GSShape/enumerateParentGroupsWithBlock:) — Invokes a block for each containing group, from the direct parent through the root group.

