Skip to content

Instantly share code, notes, and snippets.

@haikieu
Last active March 1, 2023 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haikieu/58ab90f144481dd4eeaa490060636633 to your computer and use it in GitHub Desktop.
Save haikieu/58ab90f144481dd4eeaa490060636633 to your computer and use it in GitHub Desktop.
function without golden path
func authenticateUser(_ username: String?, with password: String?) -> Bool {
if let username = username, let password = password {
//Validate usernane and password
...
return true //Assuming, the username and password are valid
} else {
//Base input, do something
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment