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 trialWameedh Mohammed Ali
5,150 Pointsexclamation 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
26,676 PointsHi 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.
Hope that helps.
Kenton Raiford
5,101 PointsI 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.
Michael Zaro
13,196 PointsI 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.
thomas lotocki
3,230 PointsThanks!
Wameedh Mohammed Ali
5,150 PointsWameedh Mohammed Ali
5,150 PointsI got it now! Your answer very clear and simple! Thank you very much Wameedh
Jhon Villalobos
7,968 PointsJhon Villalobos
7,968 PointsThanks!