Posts

Showing posts from December, 2017

Calling Methods

So, starting from my previous post on 'Optionals',  I'm focusing on one area/challenge of Swift at a time, with my immediate reactions and reflections on them written in this blog. As I've mentioned before, the purpose of this is to help me make sense of what I am learning, not revel in my lack of knowledge! Also, as before, the source material I am using to learn about Swift is from the same Ebook as before: 'Learn Code in Swift 4' by Kevin McNeish. This time I will also supplement with this from other courses I have used in the past, e.g. Treehouse to help me understand the information in context. Calling Methods So the purpose of this chapter in the Ebook is to do with appending. So, first of all, what is a method? A  method groups together one or two more lines of code that are then executed as a unit. I've always thought of these as a function put into context. E.g. 'print' is a method, or is it a function? As with any element of Swift, ther...

Optionals

The last few posts have been a summary and consolidation of what I know about Swift. It was a cathartic process, talking through what I know about it at this point and reminding myself of why I am learning it too! This blog will from now on detail my immediate thoughts and reflections about what I learn with Swift. This one starts from page 52 of 'Learn to Code in Swift 4' by Kevin McNeish. The first few chapters have been an introduction to Swift, how to navigate the Ebook, a bit about Xcode and about objects/classes. This feels like a good point to begin my 'live' reflections: Optionals ! Optionals allow you to specify that a variable or constant may return 'nil' (nothing). Now what exactly that means I'm not sure about, at this point. They seem to be an important element of Swift so I need to get my head around them. Apparently they let you be more precise - telling the code when it's OK for a value to be empty, and when not. So, if an unexpected ...

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

What I know about Swift - Part Two

I don't know how many parts I will need for explaining what I know about Swift - this may be the last one! Another note - I'm writing this without ANY reference to Swift documentation/information - it is a pure test to see what I know! In the previous entry, I described how I went about learning Swift, with the timeframe that included the learning-forgetting-relearning cycle, which I am desperate to break. Last time it was the basics about variables, constants, numbers and strings. This time it gets a little more complicated... Boolean I believe that this comes from the (mathematician?) George Boole, who worked with absolutes: true or false. To apply this to Swift, it could be to find out whether a calculation is true or not. E.g. 7 > 4 would return "true" Using the <, > (along with the = for each) symbols means that you can test to see if a value is greater than another. Conditionals The above directly links to the use of the if/else stateme...

How I learned Swift and what I know about Swift - Part 1

Following on from my 'Brief History' post, this other retrospective is to help me make sense of what I know about Swift so far and to summarise the journey I've been on with it. Subsequent posts in this blog will involve up-to-date thoughts and reflections on my current learning of Swift. Here is how I went about learning Swift: In April 2015, I started off learning Swift with several Udemy courses, including one by Rob Percival, which was very popular and highly-rated. At first, I had the naive assumption that it would all be very straightforward and easy to pick up. It wasn't! Rob's course was great if you were confident with the language, but the halfway point I was lost. The tasks seemed to be impossible to figure out without some insider knowledge. Anyway, I supplemented that course with several others on Udemy, which helped me to learn what the basics were. From there, I found a useful site: 'WeHeartSwift', which were useful in carrying out cha...

A Brief History...

Before launching into a summary of my Swift experience so far, let me state the reasons and purpose for this blog. In around April 2015, I decided to start learning the Swift language. It was fortunate timing that Apple had unveiled this new programming language, as it meant I was learning something yet to be fully established. This appealed to me as the idea of spending time and money invested in a language that would eventually become obsolete would be rather pointless! Why? Why start learning Swift? This question becomes more pertinent when I explain my background: no coding, programming or any real computer-related experience in my working career - apart from the 'essential' Microsoft programs. Why I decided to embark on my Swift Journey is based on several factors: Having been a Primary School Teacher in the UK for (in April 2015) for nearly nine years, I was keen to seek an alternative career. Coding was something that had appealed to me for a while, especially b...