# `GSLayer enumerateShapesUsingBlock:`

*Instance Method*

Invokes the block for all shapes in linear shape order.

## Declaration

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

```objc
- (void) enumerateShapesUsingBlock:(void (^)(GSShape *obj, NSInteger shapeIdx, BOOL *stop)) block;
```

```python
enumerateShapesUsingBlock_(obj: GSShape, shapeIdx: int, stop: bool, block)
```

## Discussion

Shape groups are included in the enumeration.

## See Also

### Shape Enumeration

- [`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.
- [`GSLayer enumerateComponentsWithOptions:usingBlock:`](/Core/GlyphsCore/GSLayer/enumerateComponentsWithOptions:usingBlock:) — Invokes the block for all component shapes using the given enumeration options.

