---
title: strokePath()
framework: coregraphics
role: symbol
role_heading: Instance Method
path: coregraphics/cgcontext/strokepath()
---

# strokePath()

Paints a line along the current path.

## Declaration

```swift
func strokePath()
```

## Discussion

Discussion The line width and stroke color of the context’s graphics state are used to paint the path. The current path is cleared as a side effect of calling this function.

## See Also

### Drawing the Current Graphics Path

- [drawPath(using:)](coregraphics/cgcontext/drawpath(using:).md)
- [CGPathDrawingMode](coregraphics/cgpathdrawingmode.md)
- [fillPath(using:)](coregraphics/cgcontext/fillpath(using:).md)
