I'm using a segmented picker in a form to answer simple "Yes" and "No" questions. Can the segmented picker initial state be set to nil so that neither yes or no is highlighted/selected on appear?
@State private var equipmentCheck = 0
private var answers = ["Yes", "No"]
var body: some View {
NavigationView {
Form {
Section(header: Text("Questions")) {
Text("Have the plant and equipment been checked?")
Picker("", selection: $equipmentCheck) {
ForEach(0 ..< answers.count, id: \.self) {
Text("\(self.answers[$0])")
}
}
.pickerStyle(SegmentedPickerStyle())
.padding()
}
}
}
}