stroke(_:lineWidth:)
Traces the outline of this shape with a color or gradient.
Declaration
nonisolated func stroke<S>(_ content: S, lineWidth: CGFloat = 1) -> some View where S : ShapeStyle
Parameters
- content:
The color or gradient with which to stroke this shape.
- lineWidth:
The width of the stroke that outlines this shape.
Return Value
A stroked shape.
Discussion
The following example draws a circle with a purple stroke:
Circle().stroke(Color.purple, lineWidth: 5)