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
MOD
Alex Koumparos
Python Web Development Treehouse Moderator 30,355 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!!!