Disable auto correction of UITextField

When I try to edit texts in my iPhone application (UITextfield), it auto-corrects my input.

Could you let me know how can I disable this?


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.