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 trialWei Luo
1,372 PointsTask 2
It keeps telling me to call greeting but isn't greeting() means I've called the func??
func greeting(#person: String) {
}
greeting(person:"Jerry")
1 Answer
Martin Wildfeuer
Courses Plus Student 11,071 PointsI think you inadvertently deleted the body of greeting
, which will print the name.
This should pass:
func greeting(#person: String) {
println("Hello \(person)")
}
greeting(person: "Jerry")
However, the #
for creating an external parameter is obsolete with Swift 2. You are doing the Swift 1 course, I strongly recommend doing the Swift 2 course instead, as some of the information here is outdated and won't work with the latest iOS SDK.
Follow this link for the Swift 2 track.
Wei Luo
1,372 PointsThanks Martin!!
BTW, due to I am new to all the coding stuff, I'm wondering that will SWIF 2 course explain everything?
Martin Wildfeuer
Courses Plus Student 11,071 PointsMartin Wildfeuer
Courses Plus Student 11,071 PointsTry to find out how your code differs from mine, I am veeeery confident it works ;) The Swift 2 track also starts from the very beginning, no worrie :)