Online Blended Learning Week 4 + Final Reflection

Tuesday 11/5/19

 

 

Learning plan for this week: Week 4

           

            This week's goal was to get though lessons 5 & 6 of Swift for beginners. I'm happy to announce I was able to make it through lesson 8 this week! Lessons 5 & 6 covered the topic Loops. Much like the title explains, a loop allows you to repeat blocks of code in Swift. There are three types of loops: For in Loop, While Loop, and Repeat-While Loop. The tricky thing about For in Loop is that it can crash XCode Swift Playground if you don't have a condition set to stop the loop! (Because it keeps looping and crashes the program) Examples of each loop are listed below:

 

For in Loop - (this loop allows you to repeat a block of code for a SET number of times)

 

For counter in lower...upper {

 

code

}

 

 

While Loop - (this loop will check the condition before it runs the loop)

 

While Condition {

 

code

 

}

 

Repeat-While Loop - (this loop will run the code FIRST and then check the condition, to see if it should run again)

 

repeat {

code

 

} While condition

 

Lessons 7 & 8 presented Functions: A block of code with a given name that can be executed on demand by calling that function name. Functions are really useful because they can save a lot of time by avoiding repeated code. Functions help organized code into executable blocks that we can call up to perform specific tasks. It's important to note that variables and constants that are declared/created within a function are only accessible inside that function!

 

Basic Function Syntax

 

func name () {

 

code

 

}

 

Example:

 

func addTwoNumbers () {

 

let a = 1

let b = 2

let c = a + b

 

Print (c)

 

}

 

addTwoNumbers()

 

 

In order for functions to perform their task they must be written at the bottom of the code.

 

 

Final Reflection:

 

            Over the past four weeks it has been a journey jumping into the programing world of Swift. Looking back at my original plan things have changed a bit: originally, I had planned to use the Swift textbook and Swift Playgrounds on for iPad. Things changed quickly post the first week of this assignment when I realized I had bitten off more than I could chew in two major ways. 1) Learning Swift language is not a small undertaking 2) Thinking I could create my own learning path by combining different learning recourses without enough structure.  

            One major discovery I had accomplishing this assignment was how important it is to have a structured program in place (especially when large content material is involved). I thought I could bounce between different resources of information and still accomplish a great outcome however, that quickly proved to be far too difficult. How did I expect to create a successful curriculum for a topic I knew little to nothing about? Discovering Chris's videos (which are very structured and broken down into lessons) proved to be such a life saver!

            In terms of what I've learned from my Swift lessons: I feel I've gotten a good foundation of Swift syntax. Though I still have a way to go I should be able to perform some basic programming by lesson 12 (fingers crossed). More importantly these lessons have furthered my curiosity for the Swift programming language.  I look forward to continuing Chris's classes on YouTube.