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
Brian Patterson
19,588 PointsSwift 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
Avi Zolty
2,001 Pointsremove the space between case and .Monday. You're not using dot annotation ON the case but rather .Monday is short for case Day.Monday
Avi Zolty
2,001 PointsCan you send us your code? This often happens when there is an error or it can't calculate
Brian Patterson
19,588 Points'''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() '''
Brian Patterson
19,588 PointsThank you,