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

David Zakaryan
David Zakaryan
512 Points

Tuples.Swift

I am a bit stuck here.. the constant fully is being returned and full is both greetings and language. I also modified the top to say (String, String) as 2 strings are being returned but the error says that greetings and language are both not being returned :/

P.S. sorry if it turns out to be an obvious mistake, as I am new to Swift :)

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

1 Answer

Someone asked this yesterday. Check out my response here and let me know if it helps you solve your problem: https://teamtreehouse.com/forum/tuples-objectives

David Zakaryan
David Zakaryan
512 Points

Thanks krilnon, you sure do help alot :D

No problem. I started about 3 days ago and have just done the Swift stuff, so I can answer because I'm just about a day ahead of you I guess. =P