# `GSLayer drawStackForGroup:supporting:penClass:secondaryPen:extraHandles:`

*Instance Method*

Creates painted drawing operations for a shape group.

## Declaration

```swift
func drawStack(for group: GSShapeGroup, supporting supportedFeatures: GSDrawStackFeature, penClass: AnyClass, secondaryPen secondPen: (any GSPenProtocol & NSObjectProtocol)?, extraHandles: NSMutableArray?) -> [GSDrawSlice<AnyObject>]
```

```objc
- (NSArray<GSDrawSlice *> *) drawStackForGroup:(GSShapeGroup *) group supporting:(GSDrawStackFeature) supportedFeatures penClass:(Class) penClass secondaryPen:(NSObject<GSPenProtocol> *) secondPen extraHandles:(NSMutableArray *) extraHandles;
```

```python
drawStackForGroup_supporting_penClass_secondaryPen_extraHandles_(group: GSShapeGroup, supportedFeatures: GSDrawStackFeature, penClass: type, secondPen: NSObject<GSPenProtocol>, extraHandles: list) -> list[GSDrawSlice]
```

## Parameters

- `group` — The shape group to process.
- `supportedFeatures` — The draw-stack features the consumer can process.
- `penClass` — A pen class used to collect path drawing operations.
- `secondPen` — A pen that receives auxiliary outlines.
- `extraHandles` — A collection that receives generated interactive handles.

## Discussion

Unsupported features are converted to simpler drawing operations where possible.

## See Also

### Draw Stack

- [`GSLayer drawStack`](/Core/GlyphsCore/GSLayer/drawStack) — The painted drawing operations for the complete layer.

