Checking if text fields are empty cause error in Swift 2

后端 未结 2 1204
不知归路
不知归路 2021-01-28 13:22

I am trying to check if a textbox has no value.

When I do this:

if(userEmail?.isEmpty || userPassword?.isEmpty || userPasswordRepeat?.isEmpty)  
         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-28 13:29

    Try this....

    if txtEmail.text?.isEmpty == true || txtPassword.text?.isEmpty == true || txtRePassword.text?.isEmpty == true{
            print("true")
    }
    

提交回复
热议问题