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 2.0 Basics Swift Types String Manipulation

Richard Jones
Richard Jones
3,500 Points

I can't figure out this code challenge, I don't get enough space to ask a question here and I can't move on. Now what?

Now I get more space. I see no place in your video that you used one constant and then one interpolated addition to add two strings and then a period after the second string all using interpolation. I see you adding an integer to a string. No period though. I see you calling out multiple constants and then adding their strings together with the "names" using interpolation. Never combining two strings in one constant and one interpolation and somehow adding a period in the interpolation as the directions suggest without using a concatenation. So what do I do now. I can't move. You guys should really let me see the answer so I can understand what you are doing.

strings.swift
// Enter your code below

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Richard,

I feel, just by reading your problem, that you are probably really overthinking this challenge. Pasan does do a great job of covering Sting Interpolation in the video just prior to this challenge.

However, for this challenge, the first part just wants you to assign your name to a constant, and then with String Interpolation (stored in another constant) create the sentence.

Below is the code for Task 1 of 2 to help you along. I hope it makes sense. I do, however, recommend maybe review Interpolation before moving on, as it plays a large role as you move forward with the iOS Track.

let name = "Jason"

let greeting = "Hi there, \(name)."

:dizzy:

Richard Jones
Richard Jones
3,500 Points

Thank you for your response Jason. I do agree Pasan does an amazing job explaining subjects in a simplistic manner. It is very difficult for experts to remember what it was like to be new to something. With that being said, the question in the code challenge was asking the student to do something not explained in the video. Look back, in every example we were asked to connect two strings. In the code challenge we were asked to insert one string inside another. Now I am a beginner to coding but I do understand the importance of syntax. It seems that it is a bit presumptive to ask a student in the kindergarten ios class to figure out a new syntax without showing them an example in the lesson. That's number one.

Now when I struggled with this code challenge I was at a road block and could not move on with the course. I tried every variation I could think of, nothing. I posted a message for help that I didn't realize was putting the message on a community board, didn't mean for this to be a public conversation. so I follow the links on my question and it takes me to a section of the community where people posted about my exact video. WOW, amazing how many other people are struggling with the exact same question. Their code works in xcode but not in the code challenge. I even copy/pasted code from the instructors giving the answers and code challenge would not accept that either. I finally did find a post with the code that was accepted and was able to move on. This was four hours after the problem started. Could you guys at least post a link near the code challenge that takes you to the community section where people post their questions about that lesson? I know how to get there now but when you don't and you are at a road block it is unbelievably frustrating!

My code worked in xcode, that is all I have to say!

Richard Jones
Richard Jones
3,500 Points

Last remark and I will move on with life. I have an idea that I believe in, I live in a rural area and have little access to coders so I will learn to build it myself if it is the last thing I do. I have purchased many courses, thousands of dollars into this right now. Treehouse so far is the BEST resource I have ever found. Your instructors know how to teach! Doesn't mean there are no small tweaks that could be made to improve the experience even further. I applaud the job you guys/gals have done so far. Keep it up!