Contents

strikethrough(_:color:)

Applies a strikethrough to the text.

Declaration

nonisolated func strikethrough(_ isActive: Bool = true, color: Color? = nil) -> Text

Parameters

  • isActive:

    A Boolean value that indicates whether the text has a strikethrough applied.

  • color:

    The color of the strikethrough. If color is nil, the strikethrough uses the default foreground color.

Return Value

Text with a line through its center.

See Also

Styling the view’s text