使用 guard let 时出现致命错误。这是错误:
条件绑定的初始化程序必须具有可选类型而不是“字符串”
在我使用过的代码下方:
@IBAction func signUpButtonPressed(sender: UIButton) {
guard let email = emailTextField.text! where emailTextField.text!.characters.count > 0 else {
// alert
return
}
guard let password = passwordTextField.text! where passwordTextField.text!.characters.count > 0 else {
// alert
return
}
self.registerUserAsync(email, password: password)
}