How do I make my @State value change when the picker changes?
The You selected text view never changes.
Code Block struct ContentView: View { @State var Choioce: Int? var settings = ["ch1", "ch2", "ch3"] var body: some View { Picker("Options", selection: $Choioce) { Text("Please Select One") ForEach(0 ..< settings.count) { index in Text(self.settings[index]) .tag(index) } } Text("You selected: \(settings[Choioce!])") } }
The You selected text view never changes.