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 Functions in Swift 2.0 Recap: Functions

Ben Masel
Ben Masel
2,004 Points

What should i do now?

I don't know what to do now or if i have made a mistake.

Please help!

functions.swift
// Enter your code below
func temperatureInFahrenheit(temperature: Double) {

}

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there Benjamin! Well you've got the first part set up correctly. But you never tell it what type to return. And then we also have these instructions:

For now, to make the function pass, simply return the value of the temperature parameter from the function. In the next task, we'll add more code to the body.

So your code at the end of the first step should look like this:

// Enter your code below
func temperatureInFahrenheit(temperature: Double) -> Double {
  return temperature
}

We define the function that takes a type Double which will be named temperature inside the function. That part you did just fine. Then we return a double. And in this case, we're going to return temperature. Hope this helps! :sparkles: