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 trialeric robinson
3,016 PointsI tried to modify the -> to (String, String) and the return to return (greeting, language) and many other ways but no go
I don't thing I understand what they are asking in the challenge
func greeting(person: String) -> (String, String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
}
1 Answer
Steve Hunter
57,712 PointsHi there,
You're pretty much there but you need to name the components in the returned tuple in the method signature:
func greeting(person: String) -> (greeting: String, language: String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
}
Hope that helps!
Steve.
eric robinson
3,016 Pointseric robinson
3,016 PointsThank you Steve, I've been stuck on this one for 4 days. I see that by naming the strings in the original return made all the difference. I appreciate the help.
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsNo problem - glad it helped!
Steve.