# `GSGlyph layerGroupIDsForLayer:`

*Instance Method*

The forced layer group containing a layer as an array, or `nil` when the layer is not in a group.

## Declaration

```swift
func layerGroupIDs(for layer: GSLayer) -> [String]?
```

```objc
- (NSArray<NSString *> *) layerGroupIDsForLayer:(GSLayer *) layer;
```

```python
layerGroupIDsForLayer_(layer: GSLayer) -> list[str]
```

## Parameters

- `layer` — A layer belonging to the glyph.

## Discussion

Empty layers participate in the grouping.

## See Also

### Layer Groups

- [`GSGlyph layerGroups`](/Core/GlyphsCore/GSGlyph/layerGroups) — The layer identifier groups used to check compatibility and coordinate edits across corresponding layers.
- [`GSGlyph layerGroupsInstances:masters:ignoreEmptyLayers:error:`](/Core/GlyphsCore/GSGlyph/layerGroupsInstances:masters:ignoreEmptyLayers:error:) — The layer identifier groups required by a set of instances.
- [`GSGlyph forcedLayerGroupIdsSeenLayers:ignoreEmptyLayers:`](/Core/GlyphsCore/GSGlyph/forcedLayerGroupIdsSeenLayers:ignoreEmptyLayers:) — The layer identifier groups formed without reference to configured instances.
- [`GSGlyph layerGroupIDSetForLayer:`](/Core/GlyphsCore/GSGlyph/layerGroupIDSetForLayer:) — The forced layer group containing a layer, or `nil` when the layer is not in a group.
- [`GSGlyph layerGroupIDSetForLayer:ignoreEmptyLayers:`](/Core/GlyphsCore/GSGlyph/layerGroupIDSetForLayer:ignoreEmptyLayers:) — The forced layer group containing a layer, or `nil` when the layer is not in a group.
- [`GSGlyph compatibleLayerGroupIdsForLayer:`](/Core/GlyphsCore/GSGlyph/compatibleLayerGroupIdsForLayer:) — The identifiers of layers in the same group that have compatible shapes, anchors, and path-component hints.
- [`GSGlyph collectBraceLayerIDsMasters:allKeys:`](/Core/GlyphsCore/GSGlyph/collectBraceLayerIDsMasters:allKeys:) — The font masters including representations of active Intermediate-layer locations.

