Book Image

Swift iOS Programming for Kids

By : Steffen D. Sommer, Jim Campagno
Book Image

Swift iOS Programming for Kids

By: Steffen D. Sommer, Jim Campagno

Overview of this book

This book starts at the beginning by introducing programming through easy to use examples with the Swift Playgrounds app. Kids are regularly encouraged to explore and play with new concepts to support knowledge acquisition and retention – these newly learned skills can then be used to express their own unique ideas. Children will be shown how to create their first iOS application and build their very own movie night application.
Table of Contents (21 chapters)
Swift iOS Programming for Kids
About the Authors
About the Reviewer
Customer Feedback
Getting Set Up

How the iPhone runs our program

To understand what a function is and how it works, it makes sense to first have a look at how a computer, let's say the iPhone, understands or runs our program. Remember from Chapter 1What is Programming?, that we can think of the code in our program as a recipe for the iPhone to interpret in order to know how our application should work. The way that an iPhone will read our recipe is to go through it line by line, beginning from the top and moving to the bottom, just as we would normally do with a text, book, or recipe. Maybe you already noted it in our earlier playgrounds that anything we print to the console will be printed in the same order as Xcode reads our code, line by line, from the source editor.

To make it clear, let's revisit our playground from Chapter 3, Say Hello. This was how we left it:

print("Hello World")
print("We love Swift programming")
print("My favorite ice cream is vanilla")

If you click on the small button with an arrow pointing upwards...