Posts

Showing posts with the label Case

Enumerations and Optionals: Intro to Enums (Part 1)

So here we go! I'm now 'up to date'. I can't claim that I've gone over EVERYTHING that I had learned in the previous few years, but by going through the four Treehouse courses, I feel as though I have a thorough understanding of what I should know. Just to recap, I've been re-learning constants, variables, types, operations, collections, conditionals and control flow, functions, methods, classes and structures...that's actually really impressive! I got a little lost towards the end of classes - specifically the initialisation aspect, plus the fact that I was combining a lot of concepts together. I tried to go over this but it is genuinely a real challenge to make sense of; the key point is that I've tried and will continue to gain experience. Yesterday, I looked up the init aspect and tried out a few more examples, plus went over with my 'Swifty' app. It's coming!  Now, moving onwards, I'm doing a course about enumerations. From what I ...

What I know about Swift - Part Three

This is likely to be the last post about my understanding of Swift - at this point in my journey. After this, thoughts and reflections will be "live", in the sense that they will be specifically about what I have just discovered, am trying to make clearer to me, or feel compelled to share. As before, I am not claiming that ANY of this information is technically correct or accurate; it is what I understand about Swift, at present! Enumerations and Switch I've lumped these together on the premise that Switch statements can be used within Enumerations; both use cases so there is a link there. Switch could actually have been part of the Conditionals - if/else etc. var score = 54 var comment: String = "" switch score {      case 0 ... 20 :     comment = "Good score!"      case 21 ... 50 :     comment = "Great score!"      case 50...100 :     comment = "Excellent score!" ...