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!
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
Robin Nilsson3,783 Points
Do you need to specify the enum type when creating a variable, or will it infer the type from the member?
Amit mentioned in the video that you don't need to specify the type when changing the value of an enum variable, but I am not if he was implying that you never need to specify the type (including when originally creating the variable), or if it's just not needed once it's already been created.
This is what his code looked like:
var today = Day.Monday today = .Sunday
Max Hirsh16,773 Points
Yeah, I think he meant that it's not necessary to specify which enum you're starting from after you assign an initial value.