I'm trying to capitalize the first letter of each word I put into a text field. I would like to put this code in here:
func textFieldShouldReturn(textField: UITextField) -> Bool {
//Here
}
My issue is that I have no idea what to put. I've tried creating a string like one post told me to do, and I'm having trouble:
nameOfString.replaceRange(nameOfString.startIndex...nameOfString.startIndex, with: String(nameOfString[nameOfString.startIndex]).capitalizedString)
I am not sure what to put inside that function to capitalize the first letter of each word.