O'Reilly logo

Swift for Beginners: Develop and Design, Second Edition by Boisy G. Pitre

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

Chapter 6. Formalizing with Protocols and Extensions

Congratulations on completing a set of milestone topics in the last chapter: classes, structures, and enumerations—your Swift journey through this book is almost halfway finished! Yet you’ve only scratched the surface of what Swift’s object-oriented capabilities are. There’s still plenty to explore in this area, and for now, our focus will remain on concepts related to classes and structures.

Two significant features of the Swift language expand the utility and flexibility of classes and structures: protocols and extensions. That material will carry us through this chapter.

Following Protocol

Dinner fork versus salad fork. Saying “please” and “yes, sir” or “yes, ma’am.” These are behavior ...

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