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

Fun facts app - I'm a total newbie and struggling to understand why my code isnt compiling

It appears to be the same as the tutor's but i'm getting the following alerts: 'variable xx was never mutated - consider changing'

You can see a screen shot here! http://prntscr.com/a6pugu

2 Answers

Those are just warnings. They shouldn't be preventing your code from compiling. What the warnings are basically telling you are that you have defined those variables, but then they never get changed, so Xcode is suggesting that you instead define them as constants using the let keyword. Using constants as much as possible is highly suggested when developing in Swift, hence the warnings.

Are there any actual errors coming up when you try to build?

Actually its building fine now - thanks for your advice. No errors were showing in the tutor's example - confused me!

Yeah, I think there must be some kind of setting to control how warnings appear in Xcode, because mine is the same way. Looks like it's an error (red underlines) but really just a warning.