O'Reilly logo

Swift 3 ObjectOriented Programming - Second Edition by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, you learned about the declaration and combination of multiple blueprints to generate a single instance. We declared protocols with different types of requirements. Then, we created many classes that conformed to these protocols.

We worked with type casting to understand how protocols work as types. Finally, we combined protocols with classes to take advantage of multiple inheritance in Swift 3. We combined inheritance for protocols and classes.

Now that you have learned about protocols, multiple inheritance, and contract-based programming, we are ready to maximize code reuse with generic code and parametric polymorphism.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required