[ad_1]
So as to add a Label View out of the field with out customized View one has to make use of Picker in Menu View embedded.
Now one can use modifier on the Menu Label Views and even use logic for the chosen textual content.
Menu {
Picker(choice: $gender,
label: EmptyView(),
content material: {
Textual content(Gender.male.rawValue).tag(Gender.male)
Textual content(Gender.feminine.rawValue).tag(Gender.feminine)
Textual content(Gender.nobinary.rawValue).tag(Gender.nobinary)
}).pickerStyle(.automated)
.accentColor(.white)
} label: {
Textual content(gender == .unselected ? "Choose your gender" : gender.rawValue)
.font(.title3)
.body(maxWidth: .infinity)
.body(top: 55)
.background(.white)
.cornerRadius(10)
.accentColor(.pink)
}
[ad_2]
