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.

iOS Intermediate Swift 2 Properties Computed Properties

Double check your computed property and make sure you're returning the right string for each member

An other assignment in chinese..

let UIFontTextStyleHeadline = "UIFontTextStyleHeadline"
let UIFontTextStyleBody = "UIFontTextStyleBody"
let UIFontTextStyleFootnote = "UIFontTextStyleFootnote"

enum Text {
  case Headline
  case Body
  case Footnote

  var style: String {
        Text.Headline; return "UIFontTextStyleHeadline"
        Text.Body; return "UIFontTextStyleBody"
        Text.Footnote; return "UIFontTextStyleFootnote"

3 Answers

Michael Hulet
Michael Hulet
47,843 Points

In this case, I'd recommend using a switch statement to check which case self is, and return something based on that. On a different note, are your quizzes/challenges actually in an asiatic language? If so, I'd email support about that and let them know

My dear Michael, By assignment in chinese, I'm referring that, I have to go to the next course to learn that a self switch statement can be add to a compute value. It could have been a little more organised avoiding the beginner like me, useless struggling and waste of time. Is it too much to ask?

Michael Hulet
Michael Hulet
47,843 Points

That actually is a huge organizational problem imo. I'm just a fellow student, so I can't do anything about it, but I would totally still email support, and they'll likely pass it onto the teaching team who can potentially take a look at fixing it

thks anyway