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

i do not need an answer just a hint please.

the directions are really unclear can someone explain this please.

functions.swift
// Enter your code below
func coordinates()

1 Answer

So a tuple is a group of multiple values which form a single compound value such as longitude/latitude. So for this exercise you are returning two doubles which will be the longitude and latitude of the location of the parameter string. In the body of the function you need to make a switch statement that switches on the 3 given places and returns their longitude and latitude. I labeled where the external and local names go in the code below.

func coordinates(externalNameGoesHere localNameGoesHere: String) -> (Double, Double) {

}