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

The UIViewController life cycle


As the requirements for our UI grow, we need to have more granular control of our views. We need to be able to tell what state our view is currently in inside our code. Is it, for example, shown or did the user just close the app? Is the app currently navigating from one view to another or is it just about to be shown, but still loading. All of these states refer to the  life cycle of the UIViewController, which is very important when we want to build a great UI. The life cycle of a view can be overwhelming to dive into, but often we only need a couple of these states in order to make our UIs as we want them to be. The way we handle these states is by implementing certain methods defined by Apple. Then, Apple guarantees to call these methods at the right moment according to the view life cycle. Let's take a look at some of the important states related to the UIViewController:

  • viewDidLoad(): This method will be called after a view has been loaded and is about...