Bummer! You must be logged in to access this page.

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

Martin Franzner
Martin Franzner
3,300 Points

shouldn't call println directly?

why is happening this to me?

greeting.swift
func greeting() {
  let greet = "Hello"
  println(greet)
  } 
greeting()  

6 Answers

It is looking for the simplest solution:

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

That will get you through the challenge.

Steve.

You then call it with

greeting()

as you have correctly done.

Steve.

Martin Franzner
Martin Franzner
3,300 Points

Thanks for the help Steve, but sorry, the error keeps it same. I don't have idea where is the mistake...

Weird! Can you paste your code again, or screenshot it?

Martin Franzner
Martin Franzner
3,300 Points
func greeting(){
  println("Hello")
}
greeting()

Right - Task 1 requires just:

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

Submit that the first task ... then add the next line for Task 2.

Martin Franzner
Martin Franzner
3,300 Points

Yeah, now worked, really thank you Steve!!

No problem!

:-)