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

RYAN SARGENT
PLUS
RYAN SARGENT
Courses Plus Student 1,919 Points

I am stuck on this part. I have tried to take notes on the video. I have tried a lot of ways. I could be overthinking it

var str : "Learning " let language = "Swift" var greeting = "(str)/(language)"

println("\str \language)")

println.swift
var str : "Learning "
let language = "Swift"
var greeting = "(str)/(language)"

println("\str \language)")

2 Answers

Tobias Helmrich
Tobias Helmrich
31,603 Points

Hey there,

yes, you're overthinking it a bit. You don't have to save "Learning" in a variable and also note that if you would save it you assign it to the variable with an equal sign instead of a colon. You interpolate by writing the constant/variable name in the string inside of \() and you can do this directly in the println statement without saving it in another variable or constant.

Like so:

let language = "Swift"
println("Learning \(language)")

Oh, and just a note by the way: println is deprecated in Swift 2 and you have to use print instead.

I hope that helps, if you have further questions feel free to ask. Good luck! :)

RYAN SARGENT
PLUS
RYAN SARGENT
Courses Plus Student 1,919 Points

Thank you Tobias, I really appreciate it. I think I burnt myself out last night. I wish you the best of luck! Ryan Sargent