让字符集 = CharacterSet(charactersIn: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*")
@IBAction func actionManiusAns(sender:UIButton) { if txtFldOne.text == "" && txtFldTwo.text == "" && txtFldThree.text == ""{ alert(Title: "无输入", Message: "请输入一些内容") }
else if txtFldOne.text == "" && txtFldTwo.text != "" && txtFldThree.text != ""{
alert(Title: "第一个块中没有输入", Message: "请在第一个块中输入一些内容")
}
else if txtFldOne.text == "\(characterset)" && txtFldTwo.text == "\(characterset)" && txtFldThree.text == "\(characterset)": {
alert(Title: "请使用数字", Message: "请输入数值输入")
}
else if txtFldOne.text != "" && txtFldTwo.text == "" && txtFldThree.text != "" {
alert(Title: "第二个块中没有输入", Message: "请在第二个块中输入一些内容")
}
else if txtFldOne.text != "" && txtFldTwo.text == "" && txtFldThree.text == "" {
alert(Title: "第二个块中没有输入", Message: "请在第二个块中输入一些内容")
}
else if txtFldOne.text != "" && txtFldTwo.text != "" && txtFldThree.text == "" {
alert(Title: "第三个块中没有输入", Message: "请在第三个块中输入一些内容")
}
else {
var firstNumber = Int(txtFldOne.text!)
var secondNumber = Int(txtFldTwo.text!)
var thirdNumber = Int(txtFldThree.text!)
var ans = Int(firstNumber! - secondNumber! - thirdNumber!)
lblDisply.text = "\(ans)" }
}