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

Why can't I see anything in my preview pane even when I'm getting my answers correct?

My code looks correct when I type it into Xcode, but it's not showing correct for this quiz and I'm also unable to see any previews.

strings.swift
// Enter your code below

1 Answer

Simon Di Giovanni
Simon Di Giovanni
8,429 Points

Hi Nick

I've found that if you click the 'Preview' pane and there's no information in there, it means that your code compiles correctly.

If your code complies in Xcode and theres nothing in the 'Preview' tab, and you're not able to pass the challenge, then most likely how you've written your code is not exactly how Treehouse wants it written.

I'm not sure what you've been using for the challenge, but my example below works -

// Enter your code below

let name = "Simon"

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

Please let me know if you need an explanation on what's happening with the code.

Regards

Simon