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 Build a Playlist Browser with Swift Using a Navigation Controller With Segues Modifying the UI

Wameedh Mohammed Ali
Wameedh Mohammed Ali
5,150 Points

exclamation mark (!)

In the Video there is no exclamation mark (!) next to (as) My code has an error and its asking me to put exclamation mark (!) next to (as). like this (as!) , I wonder why in the video there is no exclamation mark????!!!!

4 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Wameedh,

The reason for this is because the courses were created using Xcode 6.1 and below, since the creation of these courses Swift has been updated to include new functionality such as needing an exclamation mark for downcasting. It's important to note that while these changes alter parts of the Swift courses here on Treehouse, the underlying syntax is essentially the same so I recommend you read through the changelog of Swift to understand what these changes are.

Swift Revision History

Hope that helps.

Wameedh Mohammed Ali
Wameedh Mohammed Ali
5,150 Points

I got it now! Your answer very clear and simple! Thank you very much Wameedh

Kenton Raiford
Kenton Raiford
5,101 Points

I changed it to as! but now it doesn't seem to get me past clicking the first button. When I click it, it just shuts down.

I received the same error and the same "fix-it" solution. At first my app was crashing when I pushed the button in the simulator but I redid the code and auto-completed the segue.destinationViewController portion, then used the fix-it correction and it worked. I'm not sure why or what happened, but redoing the code seemed to fix it.