1

So I have a login screen, and it works, however my debugger is throwing the same error over and over again during typing and I can't find out WHY it's doing this.

[Assert] View <(null):0x0> does not conform to UITextInput protocol

And here's my code

let emailTextField: UITextField = {
    let textField = UITextField()
    textField.placeholder = "emailaddress".localized
    textField.translatesAutoresizingMaskIntoConstraints = false
    textField.backgroundColor = .white
    textField.font = UIFont.init(name: "AlegreyaSans-Regular", size: 18)
    textField.autocapitalizationType = .none
    textField.textContentType = .emailAddress
    textField.keyboardType = .emailAddress
    let paddingView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 10, height: 20))
    textField.leftView = paddingView
    textField.leftViewMode = .always
    return textField
}()

It renders out ok, and it works fine, however the errors are stacking up while typing.

  • See https://stackoverflow.com/questions/64363915/uitextfield-throwing-all-kinds-of-errors-in-ios-14 – Sweeper Dec 01 '20 at 00:07

1 Answers1

1

not sure if this helps you at all but I had a simile issue when I was trying to get my keyboard to be hidden when a user hits return. what I did was sent the textField's delegate to textField.delegate = self

aidenm
  • 11
  • 1