Created
June 14, 2015 11:47
-
-
Save konrad1977/a882c5120a2bca0f8cb8 to your computer and use it in GitHub Desktop.
This file contains 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 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