跳转至
Structure

DefaultLabelStyle

The default label style in the current context.

Declaration


Overview

Use this label style to ensure all the views in the hierarchy use the default label style.

This is one of 3 default label styles. These are structs that conform to the LabelStyle protocol by implementing the makeBody(configuration:) function internally, so you don't have to do it yourself.

These are the default styles:

All 3 styles have only one initializer, which takes no parameters.

To use a LabelStyle, pass it to a Label's labelStyle(_:) modifier:

A view displaying a VStack with three labels; the first reads as "<3 Banana" and is of default style, the second reads as "<3" and is of icon only style, and the third reads as "Banana" and is of title on style.

Availability

iOS 14.0+

macOS 11.0+

tvOS 14.0+

watchOS 7.0+

Topics


Instance Method

makeBody(configuration:) Creates a view that represents the body of a label.


Initializer

init() Creates a default label style.


Type Alias

Body A view that represents the body of a label.