Creating and organizing data is a key part of creating programs, but data alone does not make for a compelling program. Programs need to act on data. This can be accomplished with branching logic such as making choices based on user input. For instance, did the user set their preference for an alarm sound? If so, play that preference or default to the system standard.
You can also employ loops to rapidly iterate through large datasets. For instance, you can loop through all a user’s geo coordinates to draw their route on a map. For a person, such a task might take hours whereas an iPhone can do it in less than second.
All of this is known as control flow. Control flow means you are controlling the flow of your program’s execution. Think of the user like a marble. The user rolls down the track of your program. Control flow is the various ramps and side routes in your program.
Control flow works great with collections. Collections are ways to organize your data. Whereas a variable is like a single folder that contains a single value, a collection is like a filing cabinet containing thousands of values.
By the end of this lesson, you will:
Identify the difference between a loop and an if statement.
Detail the differences between an array and a dictionary.
Describe how to use a loop to iterate through an array.
See forum comments
This content was released on Apr 22 2025. The official support period is 6-months
from this date.
Dive into key subjects such as control flow and some important collections.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.