stroke(with:alpha:)
Draws a line along the path using the specified blend mode and transparency values.
Declaration
func stroke(with blendMode: CGBlendMode, alpha: CGFloat)Parameters
- blendMode:
The blend mode determines how the stroked path is composited with any existing rendered content.
- alpha:
The amount of transparency to apply to the stroked path. Values can range between
0.0(transparent) and1.0(opaque). Values outside this range are clamped to0.0or1.0.
Discussion
The drawn line is centered on the path with its sides parallel to the path segment. This method applies the current stroke color and drawing properties (plus the specified blend mode and transparency value) to the rendered path.
This method automatically saves the current graphics state prior to drawing and restores that state when it is done, so you do not have to save the graphics state yourself.