<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGPath/apply(info:function:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGPathApply"
  },
  "title" : "apply(info:function:)"
}
-->

# apply(info:function:)

For each element in a graphics path, calls a custom applier function.

```
func apply(info: UnsafeMutableRawPointer?, function: CGPathApplierFunction)
```

## Parameters

`info`

A pointer to the user data that Core Graphics will pass to the function being applied, or `NULL`.

`function`

A pointer to the function to apply. See [`CGPathApplierFunction`](/documentation/CoreGraphics/CGPathApplierFunction) for more information.

## Discussion

For each element in the specified path, Core Graphics calls the applier function, which can examine (but not modify) the element.

---

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)