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

Modeling real-world objects

To get a better understanding of how we can model objects in OOP, let's try to go through a couple of examples from the real world. As you will see, there are a lot of similarities when we try to model real-world objects and objects in our programs.

Modeling a mug

Using our knowledge about what OOP is, let's look at a more concrete example. Let's take a look at the object in the following photograph:

Using our real-world knowledge combined with common sense, what could be some characteristics of this mug? Instead of considering the actual values or the specifics of the mug, let's try to come up with a set of properties this mug has. We could say that the mug has a color which is the color of the ceramic, which in this case is white. We could also say something about the print on the mug. Perhaps we could generalize this into being an image or print that a mug can have. Maybe we could also model the material of the mug, which in general could be glass, ceramic,...