---
title: CGPatternCallbacks
framework: coregraphics
role: symbol
role_heading: Structure
path: coregraphics/cgpatterncallbacks
---

# CGPatternCallbacks

A structure that holds a version and two callback functions for drawing a custom pattern.

## Declaration

```swift
struct CGPatternCallbacks
```

## Overview

Overview You supply a CGPatternCallbacks structure to the function init(info:bounds:matrix:xStep:yStep:tiling:isColored:callbacks:) to create a data provider for direct access. The functions specified by the CGPatternCallbacks structure are responsible for drawing the pattern and for handling the pattern’s memory management.

## Topics

### Initializers

- [init()](coregraphics/cgpatterncallbacks/init().md)
- [init(version:drawPattern:releaseInfo:)](coregraphics/cgpatterncallbacks/init(version:drawpattern:releaseinfo:).md)

### Instance Properties

- [drawPattern](coregraphics/cgpatterncallbacks/drawpattern.md)
- [releaseInfo](coregraphics/cgpatterncallbacks/releaseinfo.md)
- [version](coregraphics/cgpatterncallbacks/version.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Sendable](swift/sendable.md)

## See Also

### Callbacks

- [CGPatternDrawPatternCallback](coregraphics/cgpatterndrawpatterncallback.md)
- [CGPatternReleaseInfoCallback](coregraphics/cgpatternreleaseinfocallback.md)
