---
title: CGPathAddRects
framework: coregraphics
role: symbol
role_heading: Function
path: coregraphics/cgpathaddrects
---

# CGPathAddRects

Appends an array of rectangles to a mutable graphics path.

## Declaration

```occ
extern void CGPathAddRects(CGMutablePathRef path, const CGAffineTransform *m, const CGRect *rects, size_t count);
```

## Parameters

- `path`: The mutable path to change.
- `m`: An affine transformation matrix, or NULL if no transformation is needed. If specified, Core Graphics applies the transformation to the rectangles before adding them to the path.
- `rects`: The array of new rectangles to add.
- `count`: The number of elements in the array.

## Discussion

Discussion This is a convenience function that adds an array of rectangles to a path. This function is equivalent to repeatedly calling the CGPathAddRect function to append the sequence of rectangles.

## See Also

### Constructing a Graphics Path

- [CGPathMoveToPoint](coregraphics/cgpathmovetopoint.md)
- [CGPathAddLineToPoint](coregraphics/cgpathaddlinetopoint.md)
- [CGPathAddLines](coregraphics/cgpathaddlines.md)
- [CGPathAddRect](coregraphics/cgpathaddrect.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)
- [CGPathAddPath](coregraphics/cgpathaddpath.md)
- [closeSubpath()](coregraphics/cgmutablepath/closesubpath().md)
