---
title: "addLine(to:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/path/addline(to:)"
---

# addLine(to:)

Appends a straight line segment from the current point to the specified point.

## Declaration

```swift
mutating func addLine(to end: CGPoint)
```

## Parameters

- `end`: The location, in user space coordinates, for the end of the new line segment.

## Discussion

Discussion After adding the line segment, the current point is set to the endpoint of the line segment.

## See Also

### Drawing a path

- [move(to:)](swiftui/path/move(to:).md)
- [addArc(center:radius:startAngle:endAngle:clockwise:transform:)](swiftui/path/addarc(center:radius:startangle:endangle:clockwise:transform:).md)
- [addArc(tangent1End:tangent2End:radius:transform:)](swiftui/path/addarc(tangent1end:tangent2end:radius:transform:).md)
- [addCurve(to:control1:control2:)](swiftui/path/addcurve(to:control1:control2:).md)
- [addEllipse(in:transform:)](swiftui/path/addellipse(in:transform:).md)
- [addLines(_:)](swiftui/path/addlines(_:).md)
- [addPath(_:transform:)](swiftui/path/addpath(_:transform:).md)
- [addQuadCurve(to:control:)](swiftui/path/addquadcurve(to:control:).md)
- [addRect(_:transform:)](swiftui/path/addrect(_:transform:).md)
- [addRects(_:transform:)](swiftui/path/addrects(_:transform:).md)
- [addRelativeArc(center:radius:startAngle:delta:transform:)](swiftui/path/addrelativearc(center:radius:startangle:delta:transform:).md)
- [addRoundedRect(in:cornerSize:style:transform:)](swiftui/path/addroundedrect(in:cornersize:style:transform:).md)
- [closeSubpath()](swiftui/path/closesubpath().md)
