---
title: "addPath(_:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgcontext/addpath(_:)"
---

# addPath(_:)

Adds a previously created path object to the current path in a graphics context.

## Declaration

```swift
func addPath(_ path: CGPath)
```

## Parameters

- `path`: A previously created path object. See doc://com.apple.coregraphics/documentation/CoreGraphics/CGPath.

## Discussion

Discussion If the source path is non-empty, then its path elements are appended in order onto the current path. The current transformation matrix (CTM) is applied to the points before adding them to the path. After the call completes, the start point and current point of the path are those of the last subpath in path.

## See Also

### Constructing a Current Graphics Path

- [beginPath()](coregraphics/cgcontext/beginpath().md)
- [move(to:)](coregraphics/cgcontext/move(to:).md)
- [addLine(to:)](coregraphics/cgcontext/addline(to:).md)
- [addLines(between:)](coregraphics/cgcontext/addlines(between:).md)
- [addRect(_:)](coregraphics/cgcontext/addrect(_:).md)
- [addRects(_:)](coregraphics/cgcontext/addrects(_:).md)
- [addEllipse(in:)](coregraphics/cgcontext/addellipse(in:).md)
- [addArc(center:radius:startAngle:endAngle:clockwise:)](coregraphics/cgcontext/addarc(center:radius:startangle:endangle:clockwise:).md)
- [addArc(tangent1End:tangent2End:radius:)](coregraphics/cgcontext/addarc(tangent1end:tangent2end:radius:).md)
- [addCurve(to:control1:control2:)](coregraphics/cgcontext/addcurve(to:control1:control2:).md)
- [addQuadCurve(to:control:)](coregraphics/cgcontext/addquadcurve(to:control:).md)
- [closePath()](coregraphics/cgcontext/closepath().md)
- [path](coregraphics/cgcontext/path.md)
- [replacePathWithStrokedPath()](coregraphics/cgcontext/replacepathwithstrokedpath().md)
