# `GSBaseObject.parent`

*Instance Property*

The object that directly contains the receiver, or `nil` when the receiver is detached.

## Declaration

```swift
weak var parent: (any GSContainerProtocol)? { get set }
```

```objc
@property (weak) GSContainer * parent;
```

```python
parent() -> GSContainer
setParent_(parent: GSContainer)
```

## Discussion

The parent is not retained. Use the parent’s collection APIs to attach or detach an object so that both sides of the relationship remain consistent.

## See Also

### Owners

- [`GSBaseObject.layer`](/Core/GlyphsCore/GSBaseObject/layer) — The layer containing the receiver, or `nil` when the receiver is detached from a layer.
- [`GSBaseObject.glyph`](/Core/GlyphsCore/GSBaseObject/glyph) — The glyph containing the receiver, or `nil` when the receiver is detached from a glyph.

