# `GSLayer.anchors`

*Instance Property*

Layer anchors keyed by anchor name.

## Declaration

```swift
var anchors: [String : GSAnchor] { get set }
```

```objc
@property (nonatomic, strong) NSDictionary<NSString *,GSAnchor *> * anchors;
```

[See also `anchors` in the Python API](https://docu.glyphsapp.com/#GSLayer.anchors)

```python
pyobjc_instanceMethods.anchors() -> dict[str, GSAnchor]
pyobjc_instanceMethods.setAnchors_(anchors: dict[str, GSAnchor])
```

## Discussion

The dictionary keys are the anchor names. Setting this property replaces all anchors.

## See Also

### Anchors

- [`GSLayer countOfAnchors`](/Core/GlyphsCore/GSLayer/countOfAnchors) — The number of anchors on the layer.
- [`GSLayer addAnchor:`](/Core/GlyphsCore/GSLayer/addAnchor:) — Adds or replaces an anchor by name.
- [`GSLayer setAnchorArray:`](/Core/GlyphsCore/GSLayer/setAnchorArray:) — Replaces all anchors with anchors from an array.
- [`GSLayer setAnchorArrayFast:`](/Core/GlyphsCore/GSLayer/setAnchorArrayFast:) — Replaces all anchors without undo registration or change notifications.
- [`GSLayer removeAnchor:`](/Core/GlyphsCore/GSLayer/removeAnchor:) — Removes an anchor from the layer.
- [`GSLayer removeAnchorWithName:`](/Core/GlyphsCore/GSLayer/removeAnchorWithName:) — Removes the anchor with a name.
- [`GSLayer switchAnchorFastName:withName:`](/Core/GlyphsCore/GSLayer/switchAnchorFastName:withName:) — Swaps two anchor names without undo registration or change notifications.
- [`GSLayer anchorChangedName:`](/Core/GlyphsCore/GSLayer/anchorChangedName:) — Updates layer anchor lookup after an owned anchor changes its name.

