<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGMutablePath/addLines(between:transform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "s:So16CGMutablePathRefa12CoreGraphicsE8addLines7between9transformySaySo7CGPointVG_So17CGAffineTransformVtF"
  },
  "title" : "addLines(between:transform:)"
}
-->

# addLines(between:transform:)

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

```
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

Calling this convenience method is equivalent to calling the [`move(to:transform:)`](/documentation/CoreGraphics/CGMutablePath/move(to:transform:)) method with the first value in the `points` array, then calling the [`addLine(to:transform:)`](/documentation/CoreGraphics/CGMutablePath/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)