strokeBorder

Returns a view that's the result of filling an inner stroke of this view with the content you supply.

ShapeView ModifieriOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+

Overloads

2 ways to call compose().strokeBorder(). Each is one SwiftUI overload, picked by the arguments you pass.

React
compose().strokeBorder(
  content?: SwiftUI.ShapeStyle,
  options?: {
    lineWidth?: number;
    antialiased?: boolean;
  }
)
Swift
@export(implementation) nonisolated func strokeBorder<S>(
    _ content: S = .foreground,
    lineWidth: CGFloat = 1,
    antialiased: Bool = true
) -> StrokeBorderShapeView<Self.Content, S, Self>
where S : ShapeStyle

Parameters

Discussion

This is equivalent to insetting self by lineWidth / 2 and stroking the resulting shape with lineWidth as the line-width.

See also

More in ShapeView modifiers.