How to make the text of UITextField to appear with First letter Capital in iPhone

try this:

tf = [[UITextField alloc] init];
tf.autocapitalizationType = UITextAutocapitalizationTypeSentences;

or set this property in the properties inspector in Interface Builder


Swift 3 :

textField.autocapitalizationType = .sentences
textField.autocapitalizationType = .words
textField.autocapitalizationType = .allCharacters

Output :

  • Sentences : This is text input.
  • Words : This Is Text Input.
  • All characters : THIS IS TEXT INPUT.

In the Attributes Inspector, near the bottom of the Text Field section, there is a setting called Capitalization with a drop down menu. Here, you can select Words, Sentences, or All Characters.

enter image description here