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 Swift Functions and Optionals Optionals Exercise: isDivisible function

Does the unwrapping process outlined in this course feel a bit ugly?

My instinct would be to continually try and create an extra function to unwrap the thing.

Yes, the fact that there are 16 questions associated with this one video/lesson seems to indicate that others had some issues with the way Amit tried to do things as well.

Personally I think it's one of those "I'm just using this as a teaching example,

but you probably won't be doing anything like this in a production environment"

sort of things.


Here's some links to other related Treehouse threads

that had alternative code to what Amit was using:

https://teamtreehouse.com/community/isdivisible-function-exercise-improvement

https://teamtreehouse.com/community/is-this-a-better-or-worse-way-to-do-this

https://teamtreehouse.com/community/would-the-following-code-also-work-2


I really wish there was a way that students could upload "alternative approach" working code

as a zip and attach it to specific videos/lessons.