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

When I tried to use println my output says: Playground execution failed:error: 'println' has been renamed to 'print'

Results in console output: Playground execution failed: /var/folders/jj/5_jsnxmx5cz1vg0gjlm9_rtm0000gn/T/./lldb/14114/playground20.swift:11:1: error: 'println' has been renamed to 'print' println ("To build an iPhone app we need to learn ") ^~~~~~~ print Swift.println:2:13: note: 'println' has been explicitly marked unavailable here public func println<T>(value: T)

2 Answers

Hi Brian!

What Swift is telling you here is that the method that was once named 'println' is now named 'print'. You will find things like this can often change in a language as new as Swift is. Apple are constantly adding new things and also changing older things around so it's important to be aware that not all of the Swift code available online will be compatible with the newer versions of Swift!

I hope this helped you out! If you need any more help then feel free to ask away!

-Luke

Thanks, I thought thats what had happened.

How can I find out if there is a way to force a Print function to take a new line now that Println doesn't work?

Thanks for your help.

Michael Hulet
Michael Hulet
47,912 Points

print automatically prints a new line now (I'm pretty sure), so you don't need to worry about forcing it. If you're looking for a new line in other functions in the future, there is a character that universally represents a new line to all functions. That character is a backslash and then a lowercase n, like this: \n