Reputation: 11231
I have a text box and I am only interested in capitalizing the first letter, So how to do that in iPhone UITextField.
Upvotes: 66
Views: 42283
Reputation: 4379
Swift 3 :
textField.autocapitalizationType = .sentences
textField.autocapitalizationType = .words
textField.autocapitalizationType = .allCharacters
Output :
Upvotes: 49
Reputation: 46965
try this:
tf = [[UITextField alloc] init];
tf.autocapitalizationType = UITextAutocapitalizationTypeSentences;
or set this property in the properties inspector in Interface Builder
Upvotes: 118
Reputation: 4335
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
.
Upvotes: 22
Reputation: 371
In the Attributes Inspector , there is a Capitalization with a drop down menu. Here, you can select Words, Sentences, or All Characters.
Upvotes: 6
Reputation: 49
Select your text field ,go in interface builder(properties option) storyboard there is a option Capatalization set it to sentence.enjoy!!!
Upvotes: 3