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 Swift Functions and Optionals Parameters and Tuples Tuples

Pratyush Tottempudi
Pratyush Tottempudi
2,035 Points

Write a function that accepts a Dictionary as parameter and returns a named tuple. Can you please help me with this?

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.

Can you provide some code that you've attempted.

1 Answer

Felix Salazar
Felix Salazar
3,879 Points

I have some doubts too. Here's a hint:

The declaration of a Dictionary type is:

paramName : Dictionary<String,String>

Hope this helps. I let figure out the rest.