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 Building the Music Library and Playlist Models Struct Initialization

I am getting errors downcasting "Did you mean to use as! to force downcast?

Is it that the course has already become outdated and the compiler has changed?

Kevin Gonzales
Kevin Gonzales
4,638 Points

The compiler changed lol as must now have a ! and be as!

So is adding the ! to as (as!) just the same code as "as" in the newer versions

Kevin Gonzales
Kevin Gonzales
4,638 Points

I think if you want to get specific they changed it because optionals and stuff(didn't look into it), but yep basically "as" is now "as!"

Thanks :)

1 Answer

Regina Soifer
Regina Soifer
7,386 Points

Change as to as!

Yes, the compiler has changed.