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 trialDrew Carver
5,189 PointsWhy use an extension for the image var?
Why did he use an extension to implement the image var, rather than just put it directly in the WeatherIcon enum? Was is just for organization purposes?
1 Answer
Christian Heine
17,520 PointsAs Abdul already mentioned, yes it's for organising - as a kind of convention. Here is a nice and concise read on the subject: Using Swift Extensions The βWrongβ Way
Tee Abdul
8,411 PointsTee Abdul
8,411 PointsYes, you're right he mentioned it in a previous course that it's for organizing.