One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

StrokeStyle

struct · iOS 13.0+ · SDK 27.1

@frozen struct StrokeStyle

The characteristics of a stroke that traces a path.

Members (15)

get · iOS 13.0+

miterLimit

TypeScript
get miterLimit(): number
Swift declaration
var miterLimit: CGFloat

A threshold used to determine whether to use a bevel instead of a miter at a join.

set · iOS 13.0+

miterLimit

TypeScript
set miterLimit(value: number)
Swift declaration
var miterLimit: CGFloat

A threshold used to determine whether to use a bevel instead of a miter at a join.

get · iOS 13.0+

animatableData

TypeScript
get animatableData(): AnimatablePair<number, AnimatablePair<number, number>>
Swift declaration
var animatableData: StrokeStyle.AnimatableData { get set }

The data to animate. SwiftUI reads this property to capture the current vector representation of the animatable state, and writes it back on each animation frame with an interpolated value. The default implementation returns ``EmptyAnimatableData``, meaning nothing is animated. Use the ``Animatable()`` macro to synthesize this property automatically. Implement it by hand only when you need custom interpolation logic such as clamping, normalization, or mapping to a derived value.

set · iOS 13.0+

animatableData

TypeScript
set animatableData(value: AnimatablePair<number, AnimatablePair<number, number>>)
Swift declaration
var animatableData: StrokeStyle.AnimatableData { get set }

The data to animate. SwiftUI reads this property to capture the current vector representation of the animatable state, and writes it back on each animation frame with an interpolated value. The default implementation returns ``EmptyAnimatableData``, meaning nothing is animated. Use the ``Animatable()`` macro to synthesize this property automatically. Implement it by hand only when you need custom interpolation logic such as clamping, normalization, or mapping to a derived value.

get · iOS 13.0+

dash

TypeScript
get dash(): Array<number>
Swift declaration
var dash: [CGFloat]

The lengths of painted and unpainted segments used to make a dashed line.

set · iOS 13.0+

dash

TypeScript
set dash(value: Array<number>)
Swift declaration
var dash: [CGFloat]

The lengths of painted and unpainted segments used to make a dashed line.

get · iOS 13.0+

lineCap

TypeScript
get lineCap(): _CoreGraphics_CGLineCap
Swift declaration
var lineCap: CGLineCap

The endpoint style of a line.

set · iOS 13.0+

lineCap

TypeScript
set lineCap(value: _CoreGraphics_CGLineCap)
Swift declaration
var lineCap: CGLineCap

The endpoint style of a line.

get · iOS 13.0+

lineJoin

TypeScript
get lineJoin(): _CoreGraphics_CGLineJoin
Swift declaration
var lineJoin: CGLineJoin

The join type of a line.

set · iOS 13.0+

lineJoin

TypeScript
set lineJoin(value: _CoreGraphics_CGLineJoin)
Swift declaration
var lineJoin: CGLineJoin

The join type of a line.

get · iOS 13.0+

dashPhase

TypeScript
get dashPhase(): number
Swift declaration
var dashPhase: CGFloat

How far into the dash pattern the line starts.

set · iOS 13.0+

dashPhase

TypeScript
set dashPhase(value: number)
Swift declaration
var dashPhase: CGFloat

How far into the dash pattern the line starts.

init · iOS 13.0+

init

TypeScript
static init(lineWidth?: number, lineCap?: _CoreGraphics_CGLineCap, lineJoin?: _CoreGraphics_CGLineJoin, miterLimit?: number, dash?: Array<number>, dashPhase?: number): StrokeStyle
Swift declaration
init(lineWidth: CGFloat = 1, lineCap: CGLineCap = .butt, lineJoin: CGLineJoin = .miter, miterLimit: CGFloat = 10, dash: [CGFloat] = [CGFloat](), dashPhase: CGFloat = 0)

Creates a new stroke style from the given components. - Parameters: - lineWidth: The width of the segment. - lineCap: The endpoint style of a segment. - lineJoin: The join type of a segment. - miterLimit: The threshold used to determine whether to use a bevel instead of a miter at a join. - dash: The lengths of painted and unpainted segments used to make a dashed line. - dashPhase: How far into the dash pattern the line starts.

get · iOS 13.0+

lineWidth

TypeScript
get lineWidth(): number
Swift declaration
var lineWidth: CGFloat

The width of the stroked path.

set · iOS 13.0+

lineWidth

TypeScript
set lineWidth(value: number)
Swift declaration
var lineWidth: CGFloat

The width of the stroked path.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →