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

How to create a function that returns a tuple with elements named 'greeting' and 'language'.

I am bog down with Challenge task 1 of 3 in Tuples: My answer is:

func greeting(#greeting: String, #language: String)->String {

   return "Hello \(greeting),  " + "Do you speak \(language) ?"

}

but i keep being denied of a the right answer. Can you help? Thanks.

1 Answer

Chris Shaw
Chris Shaw
26,676 Points

Hi Rene,

See the below link as I wrote a detailed response due to the amount of threads that are appearing because of this same question.

https://teamtreehouse.com/forum/not-sure-on-the-tuple-question-ios-swift-to-modify-the-greeting-to-return-both-language-and-greeting