Rupesh Rupesh - 6 months ago 16
Objective-C Question

How to capitalized first letter of text

There is some text in a text field. Before setting it to txtfdName, I want to capitalize the first letter.

[addrecipe.txtfdName setText:txtfield1.text];

Answer

Use autocapitalizationType for capital letter of UITextField.

txtfield1.autocapitalizationType = UITextAutocapitalizationTypeWords;