I want to change Picker's content dynamically.
But I think you cannot pass Binding property into ForEach.
@Binding var options: [String]
@Binding var selectedIndex: Int
var body: some View {
Picker(selection: self.$selectedIndex, label: Text("")) {
ForEach(0..<self.$options.count) { // error: Cannot assign to property: 'count' is a get-only property
Text(self.options[$0])
}
}
}