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

Kavita Bargota
Kavita Bargota
2,741 Points

can someone please help with a multiline string literal in Swift??

I am reading through notes attached to the video tutorials and practicing the notes on Xcode playground. I have copied the following onto Xcode:

let singleLineString = "These are the same." let multilineString = """ These are the same. """ and there is an error in the code?

it does not make sense to me as I am literally copying what Swifts guidance says...

does anyone know whats happening?

thanks

2 Answers

Tijo Thomas
Tijo Thomas
9,737 Points

Multiline string literals are a new feature that's supported in Swift 4 not Swift 3. Here's the Apple documentation

Kavita Bargota
Kavita Bargota
2,741 Points

Hi there, I am doing the beginners ios course and reading/following the documents attached which are Swift 4. I didnt realise this until some code I was inputting onto Xcode 8 was coming up as errors (forgive me i am completely new to this).

Are there any tutorials on Swift 4 on Treehouse? I am getting a little confused with everything at the moment...

I have Xcode 8, learning Swift 3 on treehouse but following and practice Apples Swift 4 guidance.....is this wrong? Should I be using xcode 9 and continue practicing as per Apples guidance Swift 4?

Also would Treehouse Swift 3 video tutorials still be appropriate? (sorry its obvious but I am new to this and have no idea)

thanks

Kavita