Skip to content

Instantly share code, notes, and snippets.

@edopelawi

edopelawi/SampleStringMethod.swift Secret

Last active Oct 12, 2016
Embed
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
You can’t perform that action at this time.