Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS 8 no longer supports UITextAutocapitalizationTypeNone

I have a foreign language dictionary type application that allows the use to enter transliterated (to English) words. The great majority of entries are lowercase, but there are a few entries that are uppercase. As of IOS 8, searchbar no longer recognizes UITextAutocapitalizationTypeNone. This causes considerable frustration for the end-users. Is there any practical strategy to turn off initial capitalization? Currently it is off in the storyboard setting for UISearchBar

This is an existing application, originally written for iOS 6. The current Apple documentation states that AutocapitalizationType is available from iOS 2 through iOS 7.1. Users reported the change after moving to iOS 8.

like image 753
Bill Avatar asked Nov 17 '14 04:11

Bill


1 Answers

autocapitalizationType was not deprecated actually. The docs are misleading. Prior to iOS 8.0, UISearchBar had the autocapitalizationType property. As of iOS 8, the property was removed but the UITextInputAttributes protocol was added. This protocol provides the autocapitalizationType property. So effectively nothing changed. The property still exists, it's just declared differently.

If the storyboard doesn't provide a working way to set the autocapitalizationType property, set it in code:

self.someSearchbar.autocapitalizationType = UITextAutocapitalizationTypeNone;
like image 110
rmaddy Avatar answered Oct 22 '22 15:10

rmaddy