Module 04 of 12

Collections & Control Flow

Lessons

About This Module

Almost every app you build will store groups of data and make decisions about what to do with it. This module covers the Swift tools for both: collections to hold your data and control flow to act on it.

You'll start with the three core collection types, arrays, dictionaries, and sets, and learn when to reach for each one. Then you'll move on to if / else if / else and switch statements for branching logic, and for loops for repeating work over ranges and collections.

Practice along in an Xcode playground as you watch. Once these feel comfortable, continue on to Functions, Closures & Optionals.

Lessons

6 videos
01

Arrays, Dictionaries and Sets in Swift

An overview of Swift's three core collection types and how to work with each of them.

02

How to use Arrays and Sets in Swift

Store and manipulate collections of data with arrays and sets, and see how they differ.

03

Learn Swift for Beginners: If, Else If, Else

Make decisions in your code with if, else if, and else.

04

Learn Swift for Beginners: Switch Statements

Handle multiple conditions cleanly with Swift's switch statement.

05

Learn Swift for Beginners: For Loops with Ranges

Repeat code a set number of times by looping over ranges.

06

How to use For Loops in Swift

Iterate over arrays, sets, dictionaries, and other collections with for-each loops.