---
title: "curve(to:controlPoint1:controlPoint2:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbezierpath/curve(to:controlpoint1:controlpoint2:)"
---

# curve(to:controlPoint1:controlPoint2:)

Adds a Bezier cubic curve to the path.

## Declaration

```swift
func curve(to endPoint: NSPoint, controlPoint1: NSPoint, controlPoint2: NSPoint)
```

## Parameters

- `endPoint`: The destination point of the curve segment, specified in the current coordinate system
- `controlPoint1`: The point that determines the shape of the curve near the current point.
- `controlPoint2`: The point that determines the shape of the curve near the destination point.

## Discussion

Discussion You must set the path’s current point (using the move(to:) method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an genericException exception.

## See Also

### Constructing a Path

- [move(to:)](appkit/nsbezierpath/move(to:).md)
- [line(to:)](appkit/nsbezierpath/line(to:).md)
- [curve(to:controlPoint:)](appkit/nsbezierpath/curve(to:controlpoint:).md)
- [close()](appkit/nsbezierpath/close().md)
- [relativeMove(to:)](appkit/nsbezierpath/relativemove(to:).md)
- [relativeLine(to:)](appkit/nsbezierpath/relativeline(to:).md)
- [relativeCurve(to:controlPoint1:controlPoint2:)](appkit/nsbezierpath/relativecurve(to:controlpoint1:controlpoint2:).md)
- [relativeCurve(to:controlPoint:)](appkit/nsbezierpath/relativecurve(to:controlpoint:).md)
