---
title: "stroke(_:blendMode:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uigraphicsrenderercontext/stroke(_:blendmode:)"
---

# stroke(_:blendMode:)

Paints a rectangular path using the currently selected stroke color and specified blend mode.

## Declaration

```swift
func stroke(_ rect: CGRect, blendMode: CGBlendMode)
```

## Parameters

- `rect`: A rectangle, specified in the Core Graphics coordinate space with values in points.
- `blendMode`: The blend mode applied to the stroke operation.

## Discussion

Discussion Before calling this method, select the stroke color with the setStroke() method on an instance of UIColor. The blend mode specifies how the new value for a given pixel is calculated, given the existing pixel value and the currently selected fill color. For more information on the blend modes available, see CGBlendMode.

## See Also

### Drawing content

- [stroke(_:)](uikit/uigraphicsrenderercontext/stroke(_:).md)
- [fill(_:blendMode:)](uikit/uigraphicsrenderercontext/fill(_:blendmode:).md)
- [fill(_:)](uikit/uigraphicsrenderercontext/fill(_:).md)
