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 As First Class Citizens Challenge

I got passed task 1, but I'm stuck on task 2.

Here is the error: http://i.imgur.com/Hwa4uHk.png

Hey, For part 2, i did this.

func printer(aString: String){
  println(aString);
}

let stringPrinter = printer
stringPrinter("hello");

This is because we want to assign the stringPrinter outside of the function. This will essentially create a reference to the function, which we can then use to pass in the variables. Assigning the stringPrinter inside of the function printer, is a topic known as recursion, which is outside of the scope of this course (at least so far).

Coinnich c That did it! Thanks a bunch!