我正在尝试使用swift和firebase在iOS项目中创建用户按钮时添加错误处理:
这是按钮的代码:
@IBAction func Register(sender: AnyObject) {
if NameTF.text == "" || EmailTF.text == "" || PasswordTF.text == "" || RePasswordTF == "" || PhoneTF.text == "" || CityTF.text == ""
{
let alert = UIAlertController(title: "?????", message:"??? ???? ???? ?? ?????? ????????", preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "???", style: .Default) { _ in })
self.presentViewController(alert, animated: true){}
} else {
if PasswordTF.text != RePasswordTF.text {
let alert = UIAlertController(title: "?????", message:"????? ?????? ??? ?????????", preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "???", style: .Default) { …Run Code Online (Sandbox Code Playgroud)