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

# addLine(to:)

Appends a straight line to the path.

## Declaration

```swift
func addLine(to point: CGPoint)
```

## Parameters

- `point`: The destination point of the line segment, specified in the current coordinate system.

## Discussion

Discussion This method creates a straight line segment starting at the current point and ending at the point specified by the point parameter. After adding the line segment, this method updates the current point to the value in point. You must set the path’s current point (using the move(to:) method or through the previous creation of a line or curve segment) before you call this method. If the path is empty, this method does nothing.

## See Also

### Constructing a path

- [move(to:)](uikit/uibezierpath/move(to:).md)
- [addArc(withCenter:radius:startAngle:endAngle:clockwise:)](uikit/uibezierpath/addarc(withcenter:radius:startangle:endangle:clockwise:).md)
- [addCurve(to:controlPoint1:controlPoint2:)](uikit/uibezierpath/addcurve(to:controlpoint1:controlpoint2:).md)
- [addQuadCurve(to:controlPoint:)](uikit/uibezierpath/addquadcurve(to:controlpoint:).md)
- [close()](uikit/uibezierpath/close().md)
- [removeAllPoints()](uikit/uibezierpath/removeallpoints().md)
- [append(_:)](uikit/uibezierpath/append(_:).md)
- [cgPath](uikit/uibezierpath/cgpath.md)
- [currentPoint](uikit/uibezierpath/currentpoint.md)
