Type Alias

CGPatternDrawPatternCallback

Draws a pattern cell.

Declaration

typealias CGPatternDrawPatternCallback = (UnsafeMutableRawPointer?, CGContext) -> Void

Parameters

info

A generic pointer to private data associated with the pattern. This is the same pointer you supplied to init(info:bounds:matrix:xStep:yStep:tiling:isColored:callbacks:).

context

The graphics context for drawing the pattern cell.

Discussion

When a pattern is used to stroke or fill a graphics path, Quartz calls your custom drawing function at the appropriate time to draw the pattern cell. The cell should be drawn exactly the same way each time the drawing function is called.

In a drawing function associated with an uncolored pattern, you should not attempt to set a stroke or fill color or color space—if you do so, the result is undefined.

To learn how to associate your drawing function with a Quartz pattern, see init(info:bounds:matrix:xStep:yStep:tiling:isColored:callbacks:) and CGPatternCallbacks.

See Also

Creating Pattern Objects

enum CGPatternTiling

Different methods for rendering a tiled pattern.

struct CGPatternCallbacks

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

typealias CGPatternReleaseInfoCallback

Release private data or resources associated with the pattern.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software