# `GSLayer countOfAttributes`

*Instance Method*

The number of attributes.

## Declaration

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

```objc
- (NSUInteger) countOfAttributes;
```

```python
countOfAttributes() -> int
```

## See Also

### Attributes

- [`GSLayer.attributes`](/Core/GlyphsCore/GSLayer/attributes) — Values that configure layer behavior and special layer formats.
- [`GSLayer attributeForKey:`](/Core/GlyphsCore/GSLayer/attributeForKey:) — The value for an attribute key, or `nil` if no value is set.
- [`GSLayer setAttributesFast:`](/Core/GlyphsCore/GSLayer/setAttributesFast:) — Replaces all attributes without registering undo or notifying the glyph.
- [`GSLayer setAttribute:forKey:`](/Core/GlyphsCore/GSLayer/setAttribute:forKey:) — Sets or removes an attribute.
- [`GSLayer setAttributeFast:forKey:`](/Core/GlyphsCore/GSLayer/setAttributeFast:forKey:) — Sets an attribute without registering undo or notifying the glyph.
- [`GSLayer removeAttributeForKey:`](/Core/GlyphsCore/GSLayer/removeAttributeForKey:) — Removes an attribute.

