How to return boolean value from a function in Swift
37,098
func checkEmail() -> Bool {
var test = true
return test
}
Elsewhere in the code....
var emailStatus = checkEmail()
Related videos on Youtube
Author by
Schuey999
Updated on October 20, 2020Comments
-
Schuey999 over 3 years
I've looked around but was suprised that I couldn't really find anything that explained this. If I have:
func checkEmail () { var test = true return test } ...elsewhere in the code.... var emailStatus = checkEmail ()
How can I make this function return the boolean value of true?