Chapter 7: Flexible Code with Protocols, Generics, and Extensions

Seasoned programmers will (or should) know the core concepts of object-oriented programming (OOP). It's been around for a while, and it has shaped the way many of us develop and think about software. But a relatively new paradigm on the scene comes in the form of protocols with protocol-oriented programming (POP). Not intended as a replacement for OOP, POP has gained a lot of traction over the years, especially with the Swift community.

In this chapter, we'll learn everything we need to know about POP, from standard implementation to associated types and then onto generics. By the end of this chapter, you'll be extremely confident with not only implementing POP in your app, ...

Get Mastering iOS 14 Programming - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.