Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Aananya Vyas
20,157 Pointscomputed properties
it shows nothing in the preview
let UIFontTextStyleHeadline = "UIFontTextStyleHeadline"
let UIFontTextStyleBody = "UIFontTextStyleBody"
let UIFontTextStyleFootnote = "UIFontTextStyleFootnote"
enum Text {
case Headline
case Body
case Footnote
var style: String {
switch self {
case .Headline:
return UIFontTextStyleHeadline
case .Body:
return UIFontTextStyleBody
case .Footnote:
return UIFontTextStyleFootnote
}
}
}
2 Answers

David Papandrew
8,386 PointsThe challenge is case-sensitive. The given enum names are all lowercase (e.g. "headline", "body", "footnote". Update the enum cases and the switch statement so that those names are lowercase and your code should pass.

akyya mayberry
3,668 PointsEnum names are captialized. Enum members are lowercase: this is just a convention. Aananya code works in Swift and the only reason why his /her code fails is because Treehouse is enforcing the convention in its code review. Overall, if Treehouse provides you with set code (the Text enum in this case), it is not a good idea to change it unless they specifically say to do so. Otherwise you can get errors like these.
Aananya Vyas
20,157 PointsAananya Vyas
20,157 Pointsit worked ! TAL!