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

getting error when trying to use println() that println is fix to "print"

I am getting error when trying to use println() that println is fix to "print" . Also I dont get the print out in console windows on the right only result shows next the the code editor in the centre .

3 Answers

Jhoan Arango
Jhoan Arango
14,575 Points

Hello

Since you are using the latest release of Xcode and Swift 2.0, the println() method has been changed to print().

ok but how did it change exactly? can you please tell us how to use it correctly and how to make lines?

Something like this will work:

print("To build an iPhone app we need to learn \(modernProgrammingLanguage)")

Hope that helps! :grinning:

To make lines in Swift 2: To print on a single line, use the optional appendNewline: argument. Otherwise print defaults to adding a carriage return at the end of each line.

print("test ", appendNewline: false); print("this")