Skip to content

Instantly share code, notes, and snippets.

@konrad1977
Created June 14, 2015 11:47
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 konrad1977/a882c5120a2bca0f8cb8 to your computer and use it in GitHub Desktop.
Save konrad1977/a882c5120a2bca0f8cb8 to your computer and use it in GitHub Desktop.
func loginUserWithUsername(username: String?, password: String?) throws -> String {
guard let username = username where username.characters.count != 0 else {
throw LoginError.EmptyUsername
}
guard let password = password where password.characters.count != 0 else {
throw LoginError.EmptyPassword
}
///Handle all the other,
return "token:" + username
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment