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!
TextField by default auto corrects values entered by users according to their locale but if you need to disable this feature then use disableAutocorrection modifier for that purpose.
An object that displays an editable text area in your interface.
Setting the autoCorrectionType to UITextAutocorrectionTypeNo did the trick
Objective-C
textField.autocorrectionType = UITextAutocorrectionTypeYes; textField.autocorrectionType = UITextAutocorrectionTypeNo;
Swift 2
textField.autocorrectionType = .Yes textField.autocorrectionType = .No
Swift 3
textField.autocorrectionType = .yes textField.autocorrectionType = .no
SwiftUI
textField.disableAutocorrection(true) textField.disableAutocorrection(false)
Swift 2
textField.autocorrectionType = .Yes textField.autocorrectionType = .No
Swift 3
textField.autocorrectionType = .yes textField.autocorrectionType = .no
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With