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!

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 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,909 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,909 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