Posts

Showing posts with the label Func

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 ...

Creating Objects from Classes

Well, it's been a little while! The last time I blogged about using Swift, I was on my Christmas Break from work. Predictably, the first few weeks of term have been busy so there has been little to no time to open up my mac and do anything coding related. So today is the first time for over a month. Too long! I remember this feeling when trying to write regularly into a diary or journal years ago. There would always be the associated guilt of not updating it often enough. It would've been tempting today to have abandoned the idea of doing anything Swift based and go for the cliched 'I'll do it another time'. But as I've mentioned in previous blogs, I'm determined not to undo and unlearn all the knowledge that I had steadily built up in my sojourn from work recently.  Anyway, onwards and upwards. The next chapter I'm tackling is all about 'Creating Objects from Classes' (Chapter 6 - pages 83 to 94) . As before, I'll do a 'live' blo...

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!" ...