init(_:value:)
Creates a labeled informational view.
Declaration
init<S1, S2>(_ title: S1, value: S2) where S1 : StringProtocol, S2 : StringProtocolParameters
- title:
A string that describes the purpose of the view.
- value:
The value being labeled.
Discussion
This initializer creates a Text label on your behalf, and treats the title similar to init(_:). See Text for more information about localizing strings.
Form {
ForEach(person.pet) { pet in
LabeledContent(pet.species, value: pet.name)
}
}