Disable auto correction of UITextField Disable auto correction of UITextField objective-c objective-c

Disable auto correction of UITextField


UITextField* f = [[UITextField alloc] init];f.autocorrectionType = UITextAutocorrectionTypeNo;        


Swift version

I landed here looking for a Swift version of this:

myInput.autocorrectionType = .No

Also read the answer by @MaikelS

Swift 3.0

textField.autocorrectionType = .no


You can use the UITextInputTraits protocol to achieve this:

myInput.autoCorrectionType = UITextAutocorrectionTypeNo;

See here for more details.