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 trialWill Feldman
3,121 PointsWhen every you are using a enum can you do the .value
Even when you reassigning the var today to Day.Sunday could you have just done this?
today = .Sunday
Because you have already declared that it is the enum Day?
Jake Cooper
Courses Plus Student 56,854 PointsJake Cooper
Courses Plus Student 56,854 PointsNo this will not work .Value syntax being used because here the
func weekdayOrWeekend ( dayOfWeek: Day ) ->String{}
is stated infunc (parameter :Type){}
allowing inner switch case can use .Value of enum as it is expecting Day.Value .... So ```enum Day{ case Value, OtherValue } func ( param : Day)-> String{switch param{ case .Value: return "string yes" default: return "string no" }
}
Look at your **return values** they must be **->String** so variable will not be suitable