Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Playlist Browser with Swift Building the Music Library and Playlist Models Creating a Data Model

Geert Van Campenhout
Geert Van Campenhout
7,308 Points

Playlist Browser (Swift) task 2 of 2: struct / dictionary / stored property

Not sure how to proceed on this task and I'ld like to find out what I'm doing wrong. Maybe I don't properly understand what they're asking for :-(

1 Answer

Hi Geert,

The second task is asking you to create a stored property called caramelDelight and initialize it as a dictionary with a key of flavor and a value of caramel. Dictionaries are key/value pairs stored within square brackets and separated by colon.

That can look like:

struct ChocolateBox {
  var caramelDelight = ["flavor" : "caramel"]
}

I hope that helps,

Steve.