---
title: "addLines(between:transform:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgmutablepath/addlines(between:transform:)"
---

# addLines(between:transform:)

Adds a sequence of connected straight-line segments to the path.

## Declaration

```swift
func addLines(between points: [CGPoint], transform: CGAffineTransform = .identity)
```

## Parameters

- `points`: An array of values that specify the start and end points of the line segments to draw. Each point in the array specifies a position in user space. The first point in the array specifies the initial starting point.
- `transform`: An affine transform to apply to the points before adding to the path. Defaults to the identity transform if not specified.

## Discussion

Discussion Calling this convenience method is equivalent to calling the move(to:transform:) method with the first value in the points array, then calling the addLine(to:transform:) method for each subsequent point until the array is exhausted. After calling this method, the path’s current point is the last point in the array.

## See Also

### Constructing a Graphics Path

- [move(to:transform:)](coregraphics/cgmutablepath/move(to:transform:).md)
- [addLine(to:transform:)](coregraphics/cgmutablepath/addline(to:transform:).md)
- [addRect(_:transform:)](coregraphics/cgmutablepath/addrect(_:transform:).md)
- [addRects(_:transform:)](coregraphics/cgmutablepath/addrects(_:transform:).md)
- [addEllipse(in:transform:)](coregraphics/cgmutablepath/addellipse(in:transform:).md)
- [addRoundedRect(in:cornerWidth:cornerHeight:transform:)](coregraphics/cgmutablepath/addroundedrect(in:cornerwidth:cornerheight:transform:).md)
- [addArc(center:radius:startAngle:endAngle:clockwise:transform:)](coregraphics/cgmutablepath/addarc(center:radius:startangle:endangle:clockwise:transform:).md)
- [addArc(tangent1End:tangent2End:radius:transform:)](coregraphics/cgmutablepath/addarc(tangent1end:tangent2end:radius:transform:).md)
- [addRelativeArc(center:radius:startAngle:delta:transform:)](coregraphics/cgmutablepath/addrelativearc(center:radius:startangle:delta:transform:).md)
- [addCurve(to:control1:control2:transform:)](coregraphics/cgmutablepath/addcurve(to:control1:control2:transform:).md)
- [addQuadCurve(to:control:transform:)](coregraphics/cgmutablepath/addquadcurve(to:control:transform:).md)
- [addPath(_:transform:)](coregraphics/cgmutablepath/addpath(_:transform:).md)
- [closeSubpath()](coregraphics/cgmutablepath/closesubpath().md)
