---
title: "stroke(_:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsbezierpath/stroke(_:)"
---

# stroke(_:)

Strokes the path of the specified rectangle using the current stroke color and the default drawing attributes.

## Declaration

```swift
class func stroke(_ rect: NSRect)
```

## Parameters

- `rect`: A rectangle in the current coordinate system.

## Discussion

Discussion The path is drawn beginning at the rectangle’s origin and proceeding in a counterclockwise direction. This method strokes the specified path immediately.

## See Also

### Related Documentation

- [set()](appkit/nscolor/set().md)
- [init(rect:)](appkit/nsbezierpath/init(rect:).md)
- [appendRect(_:)](appkit/nsbezierpath/appendrect(_:).md)

### Drawing a Path

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