-
-
Save edopelawi/f1c82db03fb8aab7aeff08078f7a5c93 to your computer and use it in GitHub Desktop.
A sample method on extracting a String from a Swift Dictionary.
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
/// Returns `String` optional representation of user's token from passed `json`. | |
func getUserToken(json: [String: AnyObject]) -> String? { | |
return json["user_token"] as? String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment