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

no raw value in Xcode ?

Hi this should return a raw value in the playground results but its not showing . im not sure why? please can you help

import UIKit

enum Day: Int {
    case Monday = 1
    case Tuesday 
    case Wednesday 
    case Thursday 
    case Friday 
    case Saturday 
    case Sunday 
}

Day.Monday.rawValue
Day.Sunday.rawValue

I see no reason why this would not work. Make sure that your playground is running, there are no other errors, then the result should be displayed in the standard editor. This works for Swift 2.X, tbh, I am not sure if it would still in Swift 3, as enum members are supposed to be lowercase. That should not fail silently and raise warnings, though.

1 Answer

Thank you Martin ,

I worked it out late last night realising the values were in black ! And my screen background was also . ( not sure how that happened) . So your suggestion of standard editor would work ??. Thank you

Sure thing :)