Summary

In this chapter, you learned about the different members of a class or blueprint. We worked with instance properties, type properties, instance methods, and type methods. We worked with stored properties, getters, setters, and property observers, and we took advantage of access modifiers to hide data.

We worked with superheroes and defined the shared properties of a specific type of lion superhero using type properties. We also worked with mutable and immutable versions of a 3D vector, following the recommendations included in the Swift API Design Guidelines. You also understood the difference between mutable and immutable classes.

Now that you have learned to encapsulate data with properties, you are ready to create class hierarchies to abstract and specialize behavior, which is the topic of the next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.117.56