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 An Introduction to Swift Programming Working With Variables

Jabor Al thani
Jabor Al thani
2,926 Points

Code works in Xcode's playground but not Treehouse's .

Im not sure why my code won't work here when it displays perfectly in Xcode's playground ,

variables.swift
// Enter your code below

var language = "Swift"

language = language + " " + "Objective-C"

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing great, but you're not fulfilling the requirements of the challenge. The challenge asks you to replace the original value of "Swift" with "Objective-C", but instead, you've appended " Objective-C" on to the end of "Swift". The final value of language in your code is "Swift Objective-C".

The final value of language should be simply "Objective-C".

Note: It is possibly to have fully functional code outside the challenge that doesn't meet challenge requirements. Challenges are very strict and looking for one specific answer.

Hope this helps, but let me know if you're still stuck! :sparkles: