April 2019
Beginner to intermediate
698 pages
15h 15m
English
You can get the completed code for this app in the code download. It is in the Chapter10/Basic Classes folder. But it is most useful to read on to create your own working example.
We will create a few different classes using what we have learned throughout this chapter to put the theory in to practice. We will also see our first example of how classes can interact with each other by passing a class as a parameter into the function of another class. We know how to do this in theory already, we just haven't seen it in practice yet.
We will also see another way to initialize our data when the class is first instantiated by using an init block.
We will create a small app that plays with the idea of simulating ...