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

Problem in tuple theme

These its the other way i have try please everybody help thx

tuples.swift
func greeting(person: String) -> (greeting:String,language:String) {
    let language = "English"
    let greeting = "Hello \(person)"

    return (greeting,language)
}
var result(greeting,_) = greeting(person:"Tom")

1 Answer

I'm not very familiar with the Swift language, so take my answer with a grain of salt.

var result = greeting("Tom")

^ This will work, but I'm not entirely sure if it's the true answer. If you wanted to use -

var result = greeting(person: "Tom")

then you would need to add an # to this line -

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

I hope that someone more familiar with Swift can give you the proper answer so that you understand what the challenge is really asking you to do. For now, this should pass the quiz.