DAY 11

PROTOCOLS AND EXTENSIONS


Today you’re going to learn some truly Swifty functionality: protocols and protocol-oriented programming (POP).

POP does away with large, complex inheritance hierarchies, and replaces them with much smaller, simpler protocols that can be combined together. This really is the fulfillment of something Tony Hoare said many years ago: “inside every large program, there is a small program trying to get out.”

Today you have six one-minute videos to watch, and you’ll meet protocols, extensions, and the combination of those two: protocol extensions. Once you’ve watched each video there’s a short test to help make sure you’ve understood what was taught.

  1. Protocolstest
  2. Protocol inheritancetest
  3. Extensionstest
  4. Protocol extensionstest
  5. Protocol-oriented programmingtest
  6. Protocols and extensions summarytest

That’s day 11 complete, so hopefully by now you know what to do: go and post about your progress online on Twitter, Facebook, Reddit, or whatever social media you like. You’re powered by POP now!

Need help? Tweet me @twostraws!

100 DAYS OF SWIFT


The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.

Back to 100 Days of Swift

Click here to visit the Hacking with Swift store >>