---
title: "strokeLine(from:to:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsbezierpath/strokeline(from:to:)"
---

# strokeLine(from:to:)

Strokes a line between two points using the current stroke color and the default drawing attributes.

## Declaration

```swift
class func strokeLine(from point1: NSPoint, to point2: NSPoint)
```

## Parameters

- `point1`: The starting point of the line.
- `point2`: The ending point of the line.

## Discussion

Discussion This method strokes the specified path immediately.

## See Also

### Related Documentation

- [move(to:)](appkit/nsbezierpath/move(to:).md)
- [line(to:)](appkit/nsbezierpath/line(to:).md)

### Drawing a Path

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