Я работаю над кодом ниже, чтобы проверить текстовые поля textField1
и textField2
, есть ли в них какой-либо ввод или нет.
Оператор IF
ничего не делает, когда я нажимаю кнопку.
@IBOutlet var textField1 : UITextField = UITextField()
@IBOutlet var textField2 : UITextField = UITextField()
@IBAction func Button(sender : AnyObject)
{
if textField1 == "" || textField2 == ""
{
//then do something
}
}