Skip to content

Instantly share code, notes, and snippets.

Last active Oct 12, 2016
What would you like to do?
A sample method on extracting a String from a Swift Dictionary.
/// 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