Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Martin Wildfeuer
PLUS
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
seal-mask
.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,719 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!