The Label for Picker is not being displayed anymore is there a way to fix this? The label used to show in earlier versions instead of the first option.
struct ExampleView: View {
var fruits = ["Banana","Apple", "Peach", "Watermelon", "Grapes" ]
@State private var selectedFruit = 0
var body: some View {
VStack {
Picker(selection: $selectedFruit, label: Text("Select Favorite Fruit")) {
ForEach(0..<fruits.count) {
Text(self.fruits[$0])
}
}
Text("Your Favorite Fruit: \(self.fruits[selectedFruit])")
}
.pickerStyle(MenuPickerStyle())
}
}