Fiducial13 Fiducial13 - 1 month ago 5
Swift Question

How do I force a text field to be upper case only in Swift?

I would like the text entry on a text field to be upper case only.

Is there a way to limit the text field to output only upper case letters or even limit the software keyboard to only display upper case letters to users?

Answer
let textFieldOutput = "Wait a moment, please."
let newString = textFieldOutput.uppercaseString
//The string is now "WAIT A MOMENT, PLEASE."
Comments