CGPath
An immutable graphics path: a mathematical description of shapes or lines to be drawn in a graphics context.
Declaration
class CGPathOverview
Neither CGPath nor CGMutablePath define functions to draw a path. To draw a Core Graphics path to a graphics context, you add the path to the graphics context by calling addPath(_:) and then call one of the context’s drawing functions—see CGContext.
Each figure in the graphics path is constructed with a connected set of lines and Bézier curves, called a subpath. A subpath has an ordered set of path elements that represent single steps in the construction of the subpath. (For example, a line segment from one corner of a rectangle to another corner is a path element. Every subpath includes a starting point, which is the first point in the subpath. The path also maintains a current point, which is the last point in the last subpath.
Topics
Creating Graphics Paths
init(rect:transform:)init(ellipseIn:transform:)init(roundedRect:cornerWidth:cornerHeight:transform:)
Copying a Graphics Path
copy()copy(using:)copy(dashingWithPhase:lengths:transform:)copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:)mutableCopy()mutableCopy(using:)
Examining a Graphics Path
Applying a Function to the Elements of a Path
Working with Core Foundation Types
Instance Methods
See Also
Related Documentation
- Quartz 2D Programming Guide