---
title: closeSubpath()
framework: swiftui
role: symbol
role_heading: Instance Method
path: swiftui/path/closesubpath()
---

# closeSubpath()

Closes and completes the current subpath.

## Declaration

```swift
mutating func closeSubpath()
```

## Discussion

Discussion Appends a line from the current point to the starting point of the current subpath and ends the subpath. After closing the subpath, your application can begin a new subpath without first calling move(to:). In this case, a new subpath is implicitly created with a starting and current point equal to the previous subpath’s starting point.

## 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)
- [addLine(to:)](swiftui/path/addline(to:).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)
