Skip to content

Instantly share code, notes, and snippets.

@roadmapper
Created September 20, 2015 19:48
Show Gist options
  • Save roadmapper/853d52fd85f7d6fbced8 to your computer and use it in GitHub Desktop.
Save roadmapper/853d52fd85f7d6fbced8 to your computer and use it in GitHub Desktop.
Noob strings
var dict = ["coffee": 3.99, "tea": 10.99, "carrots": 4.97]
print("Tea is \((String)(dict["tea"])) test")
@jasdev
Copy link

jasdev commented Sep 20, 2015

let dict: [String: Double] = ["coffee": 3.99, "tea": 10.99, "carrots": 4.97]

if let target = dict["tea"] {
    print("Tea is \(target) test")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment