jeudi 23 août 2018

Argument type 'UITextField' does not conform to expected type 'Sequence'

I'm currently watching this youtube video, learning about user signup for an app I'm working on. I'm trying to make the two textfields where you type in the password, to match. Here's the code:

@IBAction func signUpButtonTapped(_ sender: Any) {
    print("Registrer ny bruker")

    // Validate required fields are not empty
    if (firstNameTextField.text?.isEmpty)! ||
        (lastNameTextField.text?.isEmpty)! ||
        (emailAdressTextField.text?.isEmpty)! ||
        (passwordTextField.text?.isEmpty)!
    {
        // Display alert message and return
        return
    }

    // Validate password
    if ((passwordTextField.text?.elementsEqual(repeatPasswordTextField!))! != true) {
        return
    }

}

On the "validate password" I get "Argument type 'UITextField' does not conform to expected type 'Sequence'". I'm new at this, I'd really appreciate some help.

Aucun commentaire:

Enregistrer un commentaire