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 Functions and Optionals Functions Syntax and Parameters

im stuck on task 1 of 3 on the syntax-and-parameters questions.

Im stuck ive tried everything and idk what to do.

4 Answers

Hi Anthony,

What do you have so far? Also, what is the error that you receive?

func greeting() { println("Hello") }

idk what goes where and what to input

Francisco Navarro
Francisco Navarro
14,185 Points

To add a parameter to a function just put the name of the variable followed by a colon and the variable's type (String in this case)

func greeting(person: String) { println("Hello") }

thanks. This is soo hard. Im 16 and im making a download manager app. I have a google director coming down to visit me in 2 weeks to check out my app. This is hard work.