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

iOS Swift 2.0 Enumerations and Optionals Objects and Optionals Enums with Raw Values

Martin Wildfeuer
Martin Wildfeuer
Courses Plus Student 11,071 Points

Typo in Assignment

Firstly, the assignment is described as...

Assign an enum value to type South to a constant named Direction, by using a raw value with its initializer method.

...where the uppercase constant Direction should be lowercase direction instead.

Code check is only passed with lowercase direction as expected.

enum Compass: Int {
  case North = 1
  case South
  case East
  case West

let Direction = Compass(rawValue: 2) // Nope
let direction = Compass(rawValue: 2) // Yes

Secondly, I find the above sentence quite confusing, shouldn't it be more like:

Assign the enum value South of enum Compass to a constant named direction, by using a raw value with Compass' initializer method.

Dennis Parussini
.a{fill-rule:evenodd;}techdegree seal-36
Dennis Parussini
Treehouse Project Reviewer

Yeah, I found it a bit confusing too. Had to try it twice and read the assignment three times before I found out what they want.

Jay Padzensky
Jay Padzensky
4,731 Points

Hi Martin,

Thanks for sharing this with us! I'm forwarding this thread to our teaching team so they can take a look. We appreciate the heads up!

Pasan Premaratne
Pasan Premaratne
Treehouse Teacher

Sorry for the trouble! This has been fixed

Baran Ozkan
Baran Ozkan
8,818 Points

I always try to figure the challenges out myself, and it was just a waste of time trying to understand the question. Thanks Martin, that was quite helpful!