How do I force characters input into a textbox on the iPhone to upper case?
Just double-tap the shift key and a blue indicator will light up. You'll know you're in all caps because the letter keys will change to uppercase. When you're ready to switch back to lowercase, just tap the shift key once again.
SwiftUI's TextField view normally lets users write their text in whatever case they want, but if you want to control that you can force either uppercase or lowercase text using the textCase() modifier.
Set autocapitalizationType
to UITextAutocapitalizationTypeAllCharacters
on the UITextField
.
See UITextInputTraits protocol (adopted by UITextField) for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With