Contents

stroke(_:lineWidth:antialiased:)

Traces the outline of this shape with a color or gradient.

Declaration

nonisolated func stroke<S>(_ content: S, lineWidth: CGFloat = 1, antialiased: Bool = true) -> StrokeShapeView<Self, S, EmptyView> 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)

See Also

Setting the stroke characteristics