Created
January 23, 2023 02:20
-
-
Save afarnham/86506f4c3f492191e360117f0b360d84 to your computer and use it in GitHub Desktop.
This file contains 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
TextField("Target Weight", text: $viewModel.inputWeight) | |
.keyboardType(.decimalPad) | |
.onChange(of: viewModel.inputWeight, perform: { value in | |
viewModel.inputWeight = value.filter { "01234567890.".contains($0) } | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment