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

# stroke()

Draws a line along the path using the current stroke color and drawing attributes.

## Declaration

```swift
func stroke()
```

## Discussion

Discussion The drawn line is centered on the path with its sides parallel to the path segment. This method uses the current drawing attributes associated with the receiver. If a particular attribute is not set for the receiver, this method uses the corresponding default attribute.

## See Also

### Related Documentation

- [set()](appkit/nscolor/set().md)

### Drawing a Path

- [fill()](appkit/nsbezierpath/fill().md)
- [fill(_:)](appkit/nsbezierpath/fill(_:).md)
- [stroke(_:)](appkit/nsbezierpath/stroke(_:).md)
- [strokeLine(from:to:)](appkit/nsbezierpath/strokeline(from:to:).md)
- [drawPackedGlyphs(_:at:)](appkit/nsbezierpath/drawpackedglyphs(_:at:).md)
