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 Functions in Swift Adding Power to Functions Returning Complex Values

Colin Rhys
Colin Rhys
2,469 Points

How is what I am typing in wrong?!? Looks good to me

Look at the code

functions.swift
// Enter your code below
func coordinates(for location: String) -> (Double, Double) {

    var result = (0.0, 0.0)

    switch String() {
    case "Eiffel Tower": result = (48.8582, 2.2945)
    case "Great Pyramid": result = (29.9792, 31.1344)
    case "Sydney Opera House": result = (33.8587, 151.2140)
    default: result = (0,0)
    }

    return result
}

1 Answer

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi Colin,

Your error is in this line:

switch String() {

Remember that when we use switch we are testing a specific value (in this case the contents of your location variable).

Cheers,

Alex

Colin Rhys
Colin Rhys
2,469 Points

Ah, of course, Thank you!!!