---
title: close()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsbezierpath/close()
---

# close()

Closes the most recently added subpath.

## Declaration

```swift
func close()
```

## Discussion

Discussion This method closes the current subpath by creating a line segment between the first and last points in the subpath. This method subsequently updates the current point to the end of the newly created line segment, which is also the first point in the now closed subpath.

## See Also

### Related Documentation

- [fill()](appkit/nsbezierpath/fill().md)

### Constructing a Path

- [move(to:)](appkit/nsbezierpath/move(to:).md)
- [line(to:)](appkit/nsbezierpath/line(to:).md)
- [curve(to:controlPoint1:controlPoint2:)](appkit/nsbezierpath/curve(to:controlpoint1:controlpoint2:).md)
- [curve(to:controlPoint:)](appkit/nsbezierpath/curve(to:controlpoint:).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)
