Peter
Peter

Reputation: 1109

Hide iOS Keyboard Predictive Text Bar - UITextView / UITextField

Seems that setting

autocorrectionType = UITextAutocorrectionTypeNo;

for a UITextView or UITextField no longer sufficient to hide the iOS keyboard's predictive bar.

Has Apple decided that this can only be hidden by the user in keyboard settings? Or this there still some way to do this programmatically? We need to do this for our app that includes spelling exercises.

enter image description here

Upvotes: 2

Views: 1330

Answers (1)

DonMag
DonMag

Reputation: 77672

This removes the predictive text bar for me:

@IBOutlet var tf: UITextField!

override func viewDidLoad() {
    super.viewDidLoad()
    tf.autocorrectionType = .no
    tf.spellCheckingType = .no
}

Upvotes: 5

Related Questions