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 Return Types

Functions: Objective 2 help

Hello I am having trouble with the second objective where you are writing code to change Celsius to Fahrenheit within a function. I am not exactly sure how to write the body of the function in this scenario and would appreciate if i could see how you completed this task. Please and thank you, Jake.

1 Answer

Actually i was able to figure this out! I was reading the question wrong i believe. Anyways here is what i wrote (Including objective 3/3).

func temperatureInFahrenheit(temperature: Double) -> Double { return ((temperature * 9) / 5 + 32) } let fahrenheitTemp = temperatureInFahrenheit(24)