我环顾四周,但很惊讶我找不到任何解释这个的东西。如果我有:
func checkEmail ()
{
var test = true
return test
}
...elsewhere in the code....
var emailStatus = checkEmail ()
如何使此函数返回布尔值true?
答案 0 :(得分:40)
func checkEmail() -> Bool {
var test = true
return test
}
代码中的其他地方......
var emailStatus = checkEmail()