Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexanderBollbach/6f66a250c4ec2642cb4b94cd865fc850 to your computer and use it in GitHub Desktop.
Save AlexanderBollbach/6f66a250c4ec2642cb4b94cd865fc850 to your computer and use it in GitHub Desktop.
struct Test: View {
let binding: Binding<String>
let store: Store<AppState, AppAction>
init(store: Store<AppState, AppAction>) {
self.store = store
self.binding = .init(
get: { store.value.testVal },
set: { store.send(.setTestVal($0)) }
)
}
var body: some View {
Picker.init(self.store.value.testVal, selection: binding) {
Text("123").tag(1)
Text("456").tag(2)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment