Skip to content

Instantly share code, notes, and snippets.

@Pasanpr
Created February 1, 2017 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Pasanpr/5e7b352d0d45ea57abeb6c8b2f770b23 to your computer and use it in GitHub Desktop.
Save Pasanpr/5e7b352d0d45ea57abeb6c8b2f770b23 to your computer and use it in GitHub Desktop.
enum Snack {
case gum
case cookie
}
struct Item {
let price: Int
let quantity: Int
}
let inventory: [Snack: Item] = [
.gum: Item(price: 1, quantity: 5),
.cookie: Item(price: 2, quantity: 3)
]
let someItem = Item(price: 2, quantity: 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment