'Disable UITextField Predictive Text

With the release of iOS 8 I would like to disable the predictive text section of the keyboard when I begin typing in a UITextField. Not sure how this is done, any help would be appreciated!



Solution 1:[1]

Swift 2

textField.autocorrectionType = .Yes
textField.autocorrectionType = .No

Swift 3

textField.autocorrectionType = .yes
textField.autocorrectionType = .no

Solution 2:[2]

The chosen answer is correct, but you also have an option to do the same in storyboard.

All you need is to select your textfield, and under "show the Attributes inspector", set Correction to NO.

See attached image

Solution 3:[3]

like this you on or off UITextAutocorrectionType

myTextView.autocorrectionType = UITextAutocorrectionTypeNo;  
myTextView.autocorrectionType = UITextAutocorrectionTypeYes;

Solution 4:[4]

Setting autocorrectionType to .no allowed my tableview to scroll to the last entry. With predictive text on the last line was blocked from being selected.

Solution 5:[5]

For me it worked also setting the spellCheckingType as no (iOS 15, Swift 5+)

        textField.autocorrectionType = .no
        textField.spellCheckingType = .no

Solution 6:[6]

FIXED for SWIFT-3:

myTextField.autocorrectionType = .no

Solution 7:[7]

enter image description here

if you are using storyboard select your Text Field and under the attributes inspector -

Correction = No
Smart Insert = No 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Yassine ElBadaoui
Solution 3 aturan23
Solution 4 DBourne
Solution 5 Erich Flock
Solution 6 MANISH PATHAK
Solution 7 Suraj Rao