Created
August 15, 2018 07:47
-
-
Save haikieu/4c5c07460eae87f518aad32212888d31 to your computer and use it in GitHub Desktop.
function with golden path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func authenticateUser(_ username: String?, with password: String?) -> Bool { | |
guard let username = username, let password = password else { | |
//Bad input, do something and return | |
... | |
return false | |
} | |
//Golden path, everything goes well so far | |
let found = lookupDatabase(username, password) | |
return found | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment