---
title: CGPathAddPath
framework: coregraphics
role: symbol
role_heading: Function
path: coregraphics/cgpathaddpath
---

# CGPathAddPath

Appends a path to onto a mutable graphics path.

## Declaration

```occ
extern void CGPathAddPath(CGMutablePathRef path1, const CGAffineTransform *m, CGPathRef path2);
```

## Parameters

- `path1`: The mutable path to change.
- `m`: A pointer to an affine transformation matrix, or NULL if no transformation is needed. If specified, Core Graphics applies the transformation to path2 before it is added to path1.
- `path2`: The path to add.

## Discussion

Discussion If the source path is non-empty, then its path elements are appended in order onto the mutable path. After the call completes, the start point and current point of the path are those of the last subpath in path2.

## See Also

### Constructing a Graphics Path

- [CGPathMoveToPoint](coregraphics/cgpathmovetopoint.md)
- [CGPathAddLineToPoint](coregraphics/cgpathaddlinetopoint.md)
- [CGPathAddLines](coregraphics/cgpathaddlines.md)
- [CGPathAddRect](coregraphics/cgpathaddrect.md)
- [CGPathAddRects](coregraphics/cgpathaddrects.md)
- [CGPathAddEllipseInRect](coregraphics/cgpathaddellipseinrect.md)
- [CGPathAddRoundedRect](coregraphics/cgpathaddroundedrect.md)
- [CGPathAddArc](coregraphics/cgpathaddarc.md)
- [CGPathAddArcToPoint](coregraphics/cgpathaddarctopoint.md)
- [CGPathAddRelativeArc](coregraphics/cgpathaddrelativearc.md)
- [CGPathAddCurveToPoint](coregraphics/cgpathaddcurvetopoint.md)
- [CGPathAddQuadCurveToPoint](coregraphics/cgpathaddquadcurvetopoint.md)
- [closeSubpath()](coregraphics/cgmutablepath/closesubpath().md)
