Disable the keyboard suggestions for a UITextField

I have a UITableView with a bunch of UITextFields in 'em. (in a custom UITableViewCell subclass) For every UITextField I have set:

    cell.textField.textContentType = .none

I even tried:

    cell.textField.inlinePredictionType = .no // iOS >= 17 

and:

    cell.textField.keyboardType = .default
    cell.textField.autocorrectionType = .no
    cell.textField.spellCheckingType = .no
    cell.textField.autocapitalizationType = .none

Still, when I tap in one of them, I get a 'suggestion' in a bar just above the Keyboard that I can fill in my phone number.

How can I prevent that?

I am using: xcode 15.4, iOS 17.5.1. Compiling for iOS 13.0 and later.

Answered by DTS Engineer in 789402022

@Woutster You should only have to set autocorrectionType to no and specify the keyboardType


 textField.autocorrectionType = .no
 textField.keyboardType = .phonePad

Even this did not solve the problem:

            if let item = textFieldCell.textField?.inputAssistantItem {
                item.leadingBarButtonGroups = []
                item.trailingBarButtonGroups = []
            }

@Woutster You should only have to set autocorrectionType to no and specify the keyboardType


 textField.autocorrectionType = .no
 textField.keyboardType = .phonePad
Disable the keyboard suggestions for a UITextField
 
 
Q