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 Basics (retired) Types Printing Results

AJ Thomas
AJ Thomas
249 Points

Println Statement

I don't get how to do the print ln statement in swift basics. Can someone please help me with it

3 Answers

Joshua Hawthorne
Joshua Hawthorne
18,523 Points

The "println" statement has been deprecated as of Swift 2.0. You can check which version of Swift you are using by opening a terminal and typing "xcrun swift -version". The new and improved version of println is simply "print". So if you want to print "Hello World" to the console, type the following code:

print("Hello World") 

A lot of the iOS videos have not been updated to Swift 2.0 yet, so some of the syntax they show in the video will be wrong. If Xcode doesn't make an automatic suggestion your best bet is to google for the correct syntax.

AJ Thomas
AJ Thomas
249 Points

Thank you a lot Joshua Hawthorne that helped me a lot and will help me over the years