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 Creating a Function

Marie Jose Lemiere
Marie Jose Lemiere
872 Points

[SOLVED] No solution for Greeting function

Hello, Sorry but I am stuck. I tried different ways but I still have the same message "You shouldn't call 'println' directly. It needs to be in the body of the function". I don't understand where is my mistake The last code before the one attached is : 1 func greeting () { 2 println ("Hello") 3 } 4 greeting()

Thank you for your help !

greeting.swift
func greeting () {
let sentenceGreeting = "Hello"
println (sentenceGreeting)
}
greeting ()
Marie Jose Lemiere
Marie Jose Lemiere
872 Points

I found the answer by googling the message I got (with the nice "bummer"). My first code was ok (not the one I included in this post), I just needed to stop at the closing curly brace ;-)

Edited for solved