<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKOverlayPathRenderer/strokePath(_:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKOverlayPathRenderer(im)strokePath:inContext:"
  },
  "title" : "strokePath(_:in:)"
}
-->

# strokePath(_:in:)

Draws a line along the specified path.

```
func strokePath(_ path: CGPath, in context: CGContext)
```

## Parameters

`path`

The path to draw.

`context`

The graphics context in which to draw the path.

## Discussion

You must set the current stroke color before calling this method. Typically you do this by calling the [`applyStrokeProperties(to:atZoomScale:)`](/documentation/MapKit/MKOverlayPathRenderer/applyStrokeProperties(to:atZoomScale:)) method prior to drawing. If the [`strokeColor`](/documentation/MapKit/MKOverlayPathRenderer/strokeColor) property is currently `nil`, this method does nothing.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)