Protocols and extensions summary
You’ve made it to the end of the ninth part of this series, so let’s summarize:
- Protocols describe what methods and properties a conforming type must have, but don’t provide the implementations of those methods.
- You can build protocols on top of other protocols, similar to classes.
- Extensions let you add methods and computed properties to specific types such as
- Protocol extensions let you add methods and computed properties to protocols.
- Protocol-oriented programming is the practice of designing your app architecture as a series of protocols, then using protocol extensions to provide default method implementations.
Hacking with watchOS
Transfer your Swift skills to watchOS the easy way, and learn to build real-world apps in the process!