Wernzy
Wernzy

Reputation: 1098

Possible to hide predictive text bar on UITextField with keyboardType emailAddress on iOS 14?

I have a UITextField for users to enter their email address. I want to have keyboardType set to UIKeyboardTypeEmailAddress so they have the @ and . keys quickly available, but I don't want the keyboard to show the autocomplete bar above it with email address suggestions. In the past, and in other SO posts, I've seen that setting autocorrectionType to UITextAutocorrectionTypeNo is supposed to remove the bar, however on iOS 14 specifically it is still there. Is there any way to remove this bar on iOS 14?

Thanks in advance!

Upvotes: 5

Views: 1393

Answers (1)

Wernzy
Wernzy

Reputation: 1098

It seems that setting textField.textContentType = .newPassword or .oneTimeCode hides the predictive text bar, but this seems like a hack and I'm not sure yet if there are other side-effects from doing this.

Upvotes: 5

Related Questions