protocol oriented

Asked on 06/16/2025

1 search

At WWDC, Apple often discusses the concept of protocol-oriented programming, especially in the context of Swift. Protocols in Swift provide a more general way to build abstractions and work equally well with both value and reference types. A protocol is essentially an abstract set of requirements for a type, and a type conforms to a protocol by implementing all of its requirements.

For example, in the session titled "A Swift Tour: Explore Swift’s features and design," it is mentioned that protocols can be used to abstract over collection types in the Swift standard library, such as arrays, dictionaries, and sets. This allows for a flexible and powerful way to work with different types of data models.

If you're interested in learning more about how protocols are used in Swift, you might want to check out the session A Swift Tour: Explore Swift’s features and design (14:06) where protocols are discussed in detail.