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 not showing output in standard editor

For some reason when I went through the example in the initialiser video the output in the standard editor has suddenly stopped.

4 Answers

remove the space between case and .Monday. You're not using dot annotation ON the case but rather .Monday is short for case Day.Monday

Can you send us your code? This often happens when there is an error or it can't calculate

'''Swift import UIKit

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

init() {
    self = .Monday
}

func daysTillWeekend() -> Int {
    return Day.Saturday.rawValue - self.rawValue
}
func dayString() -> String {
    switch self {
    case.Monday:
    return "Monday"
    default:
        return "Other Day"
    }
}

}

var today = Day()

today.rawValue today.dayString() '''

Thank you,