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

# addLines(between:)

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

## Declaration

```swift
func addLines(between points: [CGPoint])
```

## 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.

## Discussion

Discussion Calling this convenience method is equivalent to calling the move(to:) method with the first value in the points array, then calling the addLine(to:) 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 Current Graphics Path

- [beginPath()](coregraphics/cgcontext/beginpath().md)
- [move(to:)](coregraphics/cgcontext/move(to:).md)
- [addLine(to:)](coregraphics/cgcontext/addline(to:).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)
- [addPath(_:)](coregraphics/cgcontext/addpath(_:).md)
- [closePath()](coregraphics/cgcontext/closepath().md)
- [path](coregraphics/cgcontext/path.md)
- [replacePathWithStrokedPath()](coregraphics/cgcontext/replacepathwithstrokedpath().md)
