Learning Swift – Part 3



A collection contains multiple values. In Swift there are two types of collections: Arrays and Dictionaries. An array stores an ordered list of values, whereas a dictionary stores an unordered list of values that are accessed using keys.


What is an array

Watch Video

Learn about the first collection type known as an Array, which is an ordered list of values.

Modifying an array

Watch Video

Just like any variable an Array is mutable where you can append, insert or delete items from the Array.

What is a dictionary

Watch Video

A Dictionary is an unordered list of key and value pairs that is a collection with a valuable purpose.


Control flow

In computer programming the order in which lines of code are evaluated can be altered by control flow statements. These statements can be conditional, whether or not code should be executed. They can also be loops, which determine how many times code should be executed

For-in loop

Watch Video

The For-In is a fast enumeration looping mechanism which allows you to iterate over each item in an array.

While and do-while loop

Watch Video

A freeform loop which allows you to loop while a condition is a true.

For-condition Increment

Watch Video

A classic loop construct which requires an index, condition, and increment. Usually used to index into array.

If Statement

Watch Video

The if statement is a conditional statement that allows you to change the flow of program execution based on certain conditions.

Switch Statement

Watch Video

The Switch statement is similar to the If statement. Consider it the swiss army knife of conditional statements which is packed with power features.

Comparison and Logical operators

Watch Video

Learn about the two sets of operators used in conditional statements: comparison and logical operators