---
title: "fillPath(using:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgcontext/fillpath(using:)"
---

# fillPath(using:)

Paints the area within the current path, as determined by the specified fill rule.

## Declaration

```swift
func fillPath(using rule: CGPathFillRule = .winding)
```

## Parameters

- `rule`: The rule for determining which areas to treat as the interior of the path. See doc://com.apple.coregraphics/documentation/CoreGraphics/CGPathFillRule. This parameter defaults to the doc://com.apple.coregraphics/documentation/CoreGraphics/CGPathFillRule/winding rule if unspecified.

## Discussion

Discussion If the current path contains any non-closed subpaths, this method treats each subpath as if it had been closed with the closePath() method, then applies the specified rule to determine which areas to fill. After filling the path, this method clears the context’s current path.

## See Also

### Drawing the Current Graphics Path

- [drawPath(using:)](coregraphics/cgcontext/drawpath(using:).md)
- [CGPathDrawingMode](coregraphics/cgpathdrawingmode.md)
- [strokePath()](coregraphics/cgcontext/strokepath().md)
