# `GSBaseObject.layer`

*Instance Property*

The layer containing the receiver, or `nil` when the receiver is detached from a layer.

## Declaration

```swift
var layer: GSLayer? { get }
```

```objc
@property (nonatomic, readonly) GSLayer * layer;
```

```python
layer() -> GSLayer
```

## See Also

### Owners

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

