this is my code! I want to complete this code and when I tapped on button the values of two selections start changing..
import SwiftUI
struct Container {
var one: String
var two: String
}
struct ContentView: View {
@State var container: Container
@State var list = ["1","2","3","4","5","6","7","8","9"]
var body: some View {
Picker("Select",selection: $container.one) {
ForEach(list, id: \.self) { item in
Text(item)
}
}
.pickerStyle(.menu)
Picker("Select",selection: $container.two) {
ForEach(list, id: \.self) { item in
Text(item)
}
}
.pickerStyle(.menu)
}
}