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
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
2
Getting Set Up

Pokémon type


When creating a program, there are times when you will want the instances of your various types to interact, in ways that allow them to communicate with each other (as in the real world). What does that mean exactly? Let's break it down.

To say we have an instance of a type means that we have an actual thing that can perform actions and respond to methods. It also has properties or attributes (hair color, eye color, and many more).

Let's start with a simple example and build on it as we progress through the chapter. Here's an example of a Pokemon class:

class Pokemon {
    let name: String
    init(name: String) {
        self.name = name
    }
}

Tip

All related source code for this chapter can be found here: https://github.com/swift-book-projects/swift-3-programming-for-kids/tree/master/Chapter-10

We've created a class called Pokemon. This means that we've created a brand new type that can be used anywhere throughout our iOS application (such as String,...