# `GSShapeGroup enumerateCompositionUnits:supporting:extraHandles:secondaryPen:`

*Instance Method*

Calls the block such that the shapes of the group are divided into composition units ready for display.

## Declaration

```swift
func enumerateCompositionUnits(_ code: @escaping ([GSShape], [GSShape]?, [GSShape]?) -> Void, supporting supportedFeatures: GSDrawStackFeature, extraHandles: NSMutableArray?, secondaryPen secondPen: (any GSPenProtocol & NSObjectProtocol)?)
```

```objc
- (void) enumerateCompositionUnits:(void (^)(NSArray<GSShape *> *shapes, NSArray<GSShape *> *subtractMasks, NSArray<GSShape *> *intersectMasks)) code supporting:(GSDrawStackFeature) supportedFeatures extraHandles:(NSMutableArray *) extraHandles secondaryPen:(NSObject<GSPenProtocol> *) secondPen;
```

```python
enumerateCompositionUnits_supporting_extraHandles_secondaryPen_(shapes: list[GSShape], subtractMasks: list[GSShape], intersectMasks: list[GSShape], code, supportedFeatures: GSDrawStackFeature, extraHandles: list, secondPen: NSObject<GSPenProtocol>)
```

## Discussion

- Hidden shapes are skipped.
- Mask shapes are skipped and instead provided as parameters to the block.

