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 2.0 Functions Function Parameters Returning Complex Values

thomas bethell
thomas bethell
7,772 Points

Swift Functions - Tuples/switch

Hi,

I am trying to figure out why I keep getting an error on the code here. I have read what others have posed as the solution and seen work, adjusted my mistakes, bit still get the "Make sure you are returning the correct values for each case statement" error.

Can anyone tell where my mistake is? I seem to be missing something.

func getTowerCoordinates(location: String) -> (Double, Double) {

    switch location {
    case "Eiffel Tower":
        return (48.8582, 2.2945)
    case "Great Pyramid":
        return (29.9792, 31.1344)
    case "Syndey Opera House":
        return (33.8587, 151.2140)
    default: return (0,0)
    }
}
thomas bethell
thomas bethell
7,772 Points

Got it....I spelt Sydney wrong.

Chris Howie
Chris Howie
13,216 Points

Yeah spelling's always get me caught up in challenges as well. Good job identifying it and figuring it out!