struct Label
A type-erased label of a toggle.
Availability 有効性
Technology
let label: ToggleStyleConfiguration
.Label
Use this value in your implementation of the make
method when defining a custom Toggle
. Access it through the that method’s configuration
parameter.
Because the label is a View
, you can incorporate it into the view hierarchy that you return from your style definition. For example, you can combine the label with a circle image in an HStack
:
HStack {
Image(systemName: configuration.isOn
? "checkmark.circle.fill"
: "circle")
configuration.label
}
struct Label