# `GSGlyph countOfLayers`

*Instance Method*

The number of layers.

## Declaration

```swift
func countOfLayers() -> UInt
```

```objc
- (NSUInteger) countOfLayers;
```

```python
countOfLayers() -> int
```

## See Also

### Layers

- [`GSGlyph.layers`](/Core/GlyphsCore/GSGlyph/layers) — The layers keyed by their layer identifiers.
- [`GSGlyph sortedLayers`](/Core/GlyphsCore/GSGlyph/sortedLayers) — The layers ordered by font master, with each master layer before the other layers associated with that font master.
- [`GSGlyph objectInLayersAtIndex:`](/Core/GlyphsCore/GSGlyph/objectInLayersAtIndex:) — The layer at an index in insertion order.
- [`GSGlyph layerForId:`](/Core/GlyphsCore/GSGlyph/layerForId:) — The layer for an identifier.
- [`GSGlyph layerForIdFast:`](/Core/GlyphsCore/GSGlyph/layerForIdFast:) — The existing layer for an identifier, or `nil` when the glyph does not contain it.
- [`GSGlyph setLayer:forId:`](/Core/GlyphsCore/GSGlyph/setLayer:forId:) — Adds or replaces a layer under an identifier.
- [`GSGlyph removeLayerForId:`](/Core/GlyphsCore/GSGlyph/removeLayerForId:) — Removes the layer for an identifier.
- [`GSGlyph layerForName:`](/Core/GlyphsCore/GSGlyph/layerForName:) — The first layer with an exact matching name, or `nil` when no layer matches.
- [`GSGlyph layerForName:masterId:`](/Core/GlyphsCore/GSGlyph/layerForName:masterId:) — The first layer with an exact matching name and associated font master, or `nil` when no layer matches.
- [`GSGlyph layersForName:masterIDs:`](/Core/GlyphsCore/GSGlyph/layersForName:masterIDs:) — One layer for each font master identifier, in the requested order.
- [`GSGlyph layerForKey:masterId:`](/Core/GlyphsCore/GSGlyph/layerForKey:masterId:) — The first layer with a matching derived layer key, or `nil` when no layer matches.
- [`GSGlyph layerNearestToPosition:associatedMasterId:onlyBraceLayer:tolerance:`](/Core/GlyphsCore/GSGlyph/layerNearestToPosition:associatedMasterId:onlyBraceLayer:tolerance:) — The layer nearest to a design-space position within an exclusive distance tolerance, or `nil` when no layer qualifies.
- [`GSGlyph layerAtLocation:ignoring:`](/Core/GlyphsCore/GSGlyph/layerAtLocation:ignoring:) — Returns the layer at the given design space location.
- [`GSGlyph sortLayers:`](/Core/GlyphsCore/GSGlyph/sortLayers:) — Orders layers by font master, placing each master layer before the other layers associated with that font master.
- [`GSGlyph resetLayerKeys`](/Core/GlyphsCore/GSGlyph/resetLayerKeys) — Marks the derived layer keys of all layers for reevaluation.

