Summary

In this chapter, you learned how to take advantage of simple inheritance to specialize a base class. We designed many classes from top to bottom using chained initializers, type properties, computed properties, stored properties, and methods. Then, we coded most of these classes in the interactive Playground, taking advantage of the different mechanisms provided by Swift.

We took advantage of operator functions to overload operators that we could use with the instances of our classes. In addition, we declared operator functions to create our own operators. We overrode and overloaded initializers, type properties, and methods. We took advantage of one of the most exciting object-oriented features: polymorphism.

Now that you have learned to work with inheritance, abstraction, and specialization, we are ready to work with protocols, 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
3.22.51.241