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

A more efficient way to list out the artists

During the video you have us create a label for each artist in the array. I thought this was a little redundant so I looked for a more efficient way to display the artist list within the Detail View. I also noticed you only created 3 labels for the artists even though there were many more.

Since we assigned the text property of each label with the value of the array within playlist!.artists I figured we should be able to string along each value in the array. I found this little snippet:

var artistList = join("\n", playlist!.artists)
playlistArtist0.text = artistList

What this does is goes through the array and joins them all together with a line break in between each. Also, if you set the Lines property of a Label to "0" then it will auto size the number of lines so you don't need to set it unless you want to restrict the number of lines.