The memory debugger shows:
UIKeyboardImpl -> UIKBAutofillController -> NSMutableDictionary -> NSMutable...(Storage) -> UITextField
Any idea what's going on there?
Code Block textField.autocorrectionType = UITextAutocorrectionType.no
It helps if keyboardType = .default
, but doesn't for numberPad
, for example - UIKBautofillController
retains text field again.
In my case it was phone number field, so I set textContentType = nil
and tried to prevent heuristics to detect content type - removed placeholder, renamed outlet and field class; still no luck - autofill controller was here.
Code Block textField.autocorrectionType = UITextAutocorrectionType.no
It helps if keyboardType = .default
, but doesn't for numberPad
, for example - UIKBautofillController
retains text field again.
In my case it was phone number field, so I set textContentType = nil
and tried to prevent heuristics to detect content type - removed placeholder, renamed outlet and field class; still no luck - autofill controller was here.
If anyone (else) is coming across this issue with their custom UITextInput control. The following work around will work (assuming you don't need autocorrect):
var autocorrectionType: UITextAutocorrectionType {
get { .no }
set { fatalError() }
}