---
title: "apply(info:function:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgpath/apply(info:function:)"
---

# apply(info:function:)

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

## Declaration

```swift
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 doc://com.apple.coregraphics/documentation/CoreGraphics/CGPathApplierFunction for more information.

## Discussion

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

## See Also

### Applying a Function to the Elements of a Path

- [CGPathApplierFunction](coregraphics/cgpathapplierfunction.md)
- [CGPathElement](coregraphics/cgpathelement.md)
- [CGPathElementType](coregraphics/cgpathelementtype.md)
