# `GSLayer enumerateComponentsWithOptions:usingBlock:`

*Instance Method*

Invokes the block for all component shapes using the given enumeration options.

## Declaration

```swift
func enumerateComponents(options opts: NSEnumerationOptions = [], using block: @escaping (GSComponent, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
```

```objc
- (void) enumerateComponentsWithOptions:(NSEnumerationOptions) opts usingBlock:(void (^)(GSComponent *component, NSInteger shapeIdx, BOOL *stop)) block;
```

```python
enumerateComponentsWithOptions_usingBlock_(opts: NSEnumerationOptions, 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 enumerateComponentsUsingBlock:`](/Core/GlyphsCore/GSLayer/enumerateComponentsUsingBlock:) — Invokes the block for all component shapes in linear shape order.

