Contents

stroke(_:with:lineWidth:)

Draws a path into the context with a specified line width.

Declaration

func stroke(_ path: Path, with shading: GraphicsContext.Shading, lineWidth: CGFloat = 1)

Parameters

  • path:

    The path to outline.

  • shading:

    The color or pattern to use when outlining the path.

  • lineWidth:

    The width of the stroke, which defaults to 1.

Discussion

When you call this method, all StrokeStyle properties other than lineWidth take their default values. To control other style properties, use stroke(_:with:style:) instead.

See Also

Drawing a path