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 trialRafael Quintero
9,935 PointsI don't think I'm missing anything in the code, and it is still marking it wrong.
I copy pasted the code into Xcode and called the function with a person's name and it keeps telling me that the name is an unresolved identifier.
func greeting(person: String) -> (String, String) {
let language = "English"
let greeting = "Hello \(person)"
return (greeting, language)
}
1 Answer
Geoff Parsons
11,679 PointsLooks like you're missing the last bit about naming the items in the tuple.
Rafael Quintero
9,935 PointsRafael Quintero
9,935 PointsThank you, but what do you mean by that?
Geoff Parsons
11,679 PointsGeoff Parsons
11,679 PointsA named tuple is in the form
(name: value)
To use them as a return value you'll also need to modify your function definition to reference the names. For more information check out our blog post about tuples in swift.