<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContextAddLines",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGContextAddLines"
  },
  "title" : "CGContextAddLines"
}
-->

# CGContextAddLines

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

```
extern void CGContextAddLines(CGContextRef c, const CGPoint *points, size_t count);
```

## Parameters

`c`

A graphics context .

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

`count`

The number of elements in the `points` array.

## Discussion

This is a convenience function that moves to the first point in the sequence and then adds a line to each of the other points, sequentially.

---

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)