<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContext/fillPath(using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "s:So12CGContextRefa12CoreGraphicsE8fillPath5usingyAC14CGPathFillRuleO_tF"
  },
  "title" : "fillPath(using:)"
}
-->

# fillPath(using:)

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

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

## Parameters

`rule`

The rule for determining which areas to treat as the interior of the path. See [`CGPathFillRule`](/documentation/CoreGraphics/CGPathFillRule).

    This parameter defaults to the [`CGPathFillRule.winding`](/documentation/CoreGraphics/CGPathFillRule/winding)     rule if unspecified.

## Discussion

If the current path contains any non-closed subpaths, this method treats each subpath as if it had been closed with the [`closePath()`](/documentation/CoreGraphics/CGContext/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)