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

Array Challenges for Swift Broken?

I am doing the array challenge for Swift and the compiler will NOT let me pass. I've checked all my work, I've even tried it on Xcode and it works fine. I tried many different types of way to append the list but nothing is working.

The picture of the code compared side to side can be found here : https://twitter.com/amitnkalra/status/600883588842672128

If you can post your code I can check the challenge.

1 Answer

Hi Amit,

The compiler is working correctly as you do actually have errors with your code based on the side-by-side image you uploaded, in the challenge you wrote the following.

todo.append = ("Debug App")
todo.append = ("Fix Bugs")

This is invalid code as append is a method thus making the equals sign = invalid, instead you should have the following which is what you did have in Xcode.

todo.append("Debug App")
todo.append("Fix Bugs")

Happy coding!

Woah, I didn't even notice that! Thanks!

You're welcome.