Instruction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Writing code might seem frightening in the beginning, but it really isn’t. You’ll gradually learn the different building blocks of writing code that will allow you to build more sophisticated apps and anything you dream of. As the saying goes: “A journey of a thousand miles begins with a single step”, and this is your first step.

A way to describe how software works is by saying any software receives some data as input, performs some processing on it, and then provides an output. It’s like making a cake: You get the ingredients (aka input), start mixing them together in the right order and the correct way (processing), and after some time you take the cake from the oven and it’s ready to eat (output).

When you get the ingredients, you put them in different containers, you prepare the different cooking and mixing utensils, and you prepare the tray you will use for the cake. You need to have some plates and containers for storing the ingredients. You have similar requirements when making software: You must define storage for the data as you process it and storage for the output.

Declaring Variables

Declaring a variable or storage unit in Swift consists of four parts:

Primitive Datatypes

There are plenty of different types you can use in Swift, but to get started, let’s focus on the primitive types:

See forum comments
Download course materials from Github
Previous: Introduction Next: Demo