# `GSLayer enumerateComponentsUsingBlock:`

*Instance Method*

Invokes the block for all component shapes in linear shape order.

## Declaration

```swift
func enumerateComponents(_ block: @escaping (GSComponent, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
```

```objc
- (void) enumerateComponentsUsingBlock:(void (^)(GSComponent *component, NSInteger shapeIdx, BOOL *stop)) block;
```

```python
enumerateComponentsUsingBlock_(component: GSComponent, shapeIdx: int, stop: bool, block)
```

## See Also

### Shape Enumeration

- [`GSLayer enumerateShapesUsingBlock:`](/Core/GlyphsCore/GSLayer/enumerateShapesUsingBlock:) — Invokes the block for all shapes in linear shape order.
- [`GSLayer enumeratePathsUsingBlock:`](/Core/GlyphsCore/GSLayer/enumeratePathsUsingBlock:) — Invokes the block for all path shapes in linear shape order.
- [`GSLayer enumeratePathsWithOptions:usingBlock:`](/Core/GlyphsCore/GSLayer/enumeratePathsWithOptions:usingBlock:) — Invokes the block for all path shapes using the given enumeration options.
- [`GSLayer enumerateComponentsWithOptions:usingBlock:`](/Core/GlyphsCore/GSLayer/enumerateComponentsWithOptions:usingBlock:) — Invokes the block for all component shapes using the given enumeration options.

