lundi 28 décembre 2015

Why does it always only show the first alert?

I want do make a register view and for that I want to make to fields for a password. the first to choose a password and the second to confirm it. And I also want to check if the Emailadress is a Emailadress I want to be able to log in. The App will only be for my friends. The Problem is, that no matter what I put in the textfields it always show the first alert.

Can someone help me what I've done wrong?

@IBAction func register(sender: AnyObject) {

    if RegisterPassword1 != RegisterPassword2 {
        let alert = UIAlertView()
        alert.title = "Fehler"
        alert.message = "Passwörter stimmen nicht überein!"
        alert.addButtonWithTitle("Ok")
        alert.show()
    } else if ListOfAllEmail.contains(RegisterEmailadress.text!) {
        self.performSegueWithIdentifier("UserIdentified", sender: self)
    } else {
        let alert = UIAlertView()
        alert.title = "Fehler"
        alert.message = "Emailadresse steht nicht im Rodel!"
        alert.addButtonWithTitle("Ok")
        alert.show()
    }
}

Aucun commentaire:

Enregistrer un commentaire