Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Words Not Auto Capitalizing in UISearchBar

I have a search bar and I am trying to have words auto capitalize, like this:

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
    searchBar.showsCancelButton = YES;
    searchBar.autocapitalizationType = UITextAutocapitalizationTypeWords;
}

The shift key is highlighted by default when the keyboard comes up but it doesn't capitalize any words automatically. What am I doing wrong?

like image 682
raginggoat Avatar asked Dec 27 '13 17:12

raginggoat


1 Answers

Capitalization is ignored when you use your hardware keyboard while testing with the simulator. Try in a device or use the Simulator's keyboard.

like image 61
Guilherme Avatar answered Oct 28 '22 16:10

Guilherme