Created
September 9, 2019 21:31
-
-
Save AlexanderBollbach/6f66a250c4ec2642cb4b94cd865fc850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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