If I place a Picker or a Toggle in a SwiftUI Form, the associated label is always visible:
But for a TextField, the label is only shown while the field is empty:
And as soon as I start to fill in the TextField, the label disappears.
So now I have no context for what the TextField is meant for.
This would not be a problem if the TextField content is self explanatory, but I have a form with multiple TextFields used to input numerical values, and once they are filled in I have no context for differentiating between each number.
Is there any way to make a SwiftUI TextField behave like a Picker or Toggle, and have the label permanently displayed?
Update:
After trying out Benzy's answer of using LabeledContent, I get this sort of result when I have multiple fields. As you can see the alignment of the TextFields themselves depends on the length of the text in the LabeledContent. I'd prefer to align the TextFields.






