lundi 1 juin 2015

If statement in swift

I am trying to run following code:

@IBOutlet var nameField: UITextField!
@IBOutlet var usernameField: UITextField!
@IBOutlet var passwordField: UITextField!
@IBOutlet var emailField: UITextField!
if nameField.text == "" || usernameField.text == "" || passwordField.text == "" || emailField.text == ""{
    println("error")
}

But I am getting compiler error on XCode 6.

Invalid character in source file
Expected '{' after 'if' condition
Braced block of statements is an unused closure

How can I resolve them ?

Screenshot:

enter image description here

Aucun commentaire:

Enregistrer un commentaire