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 2.0 Enumerations and Optionals Objects and Optionals Enums with Raw Values

shane reichefeld
PLUS
shane reichefeld
Courses Plus Student 2,232 Points

I dont understand whats im supposed to do?

Am i reading the question wrong? can someone help

enums.swift
enum Compass: Int {
  case North = 100
  case South = 200
  case East = 300
  case West = 400
}
let direction = Compass(rawValue: South)

1 Answer

Jhoan Arango
Jhoan Arango
14,575 Points

Hello:

You are almost there, you got the idea.

But if you look at the initializer, it's asking you for the rawValue. Remember you assigned raw values of type integers, so guess what you should put in the initializer?

I'll leave it like this, so you can figure the rest.

let me know if you can't figure it out.

Good luck.