I want to disable Autocorrection for all text fields in my application. I know the autocorrectionType property on a UITextField. However, when I started developing the application, I did not subclass UITextField. So I'm looking for a solution to turn off auto-replace on my entire TextField with a single line of code.
I tried using [UITextField appearance] , which works for the appearance of the keyboard:
[[UITextField appearance] setKeyboardAppearance:UIKeyboardAppearanceDark];
But not for auto-correction, as the following line of code:
[[UITextField appearance] setAutocorrectionType:UITextAutocorrectionTypeNo];
Results in case of inconsistency:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please file a radar on UIKit if you see this assertion.'
Hless source share