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 Enums and Structs Enums Enum Members and Raw Values

Jonathan Mitchell
Jonathan Mitchell
1,209 Points

Can you assign multiple types to each mem

Can you make a member a type int and a type string at the same time

I know you can make enum Day: Int {} which makes Days available as integers, but can I also make the members of type string at the same time as well as int types?

in the line: return Day.Saturday.rawValue - day.rawValue

if I change Day.Saturday.rawValue to day.Saturday.rawValue and then hover of "day" it says it is of type L, (of there is an L next to it). What does that L represent?

1 Answer

Jhoan Arango
Jhoan Arango
14,575 Points

This is a random answer since I am not 100% sure, but it’s something you can try. Use AnyObject as the type, see how that works.

Jonathan Mitchell
Jonathan Mitchell
1,209 Points

What about the second part of the question, involving the "L" symbol?