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
Dylan Bailey
8,658 PointsQuestion about the Tuples extra credit in the Swift course.
Hello everyone!
I am going through the Swift courses on here, and I just finished the extra credit portion for Parameters and Tuples. I'm posting this question, because I'd like some feedback on my code:
"Write a function that accepts a Dictionary as parameter and returns a named tuple. The dictionary should contain the following keys: title, artist and album."
I ended up doing this by myself, so I am a little proud of myself for not having to look up the answer or anything. Any improvements on it or anything? Would love some feedback!
-Dylan

Vinny Harris-Riviello
11,898 PointsVinny Harris-Riviello
11,898 PointsThat is nice Dylan, but you are actually not taking in a Dictionary as a parameter, what you are doing in your code is taking in three separate String parameters. If you wanted to take a Dictionary as a parameter you would have to define is as:
func someFunction (aDictionary: Dictionary<String, String>)Hope that helps