October 2017
Intermediate to advanced
210 pages
5h 32m
English
In this chapter, we looked at extensions and protocol extensions. In the original version of Swift, we were able to use extensions to extend structures, classes, and enumerations, but since Swift 2, we have also been able to use extensions to extend protocols.
Without protocol extensions, protocol-oriented programming would not be possible, but we need to make sure that we use protocol extensions where appropriate and do not try to use them where regular extensions should be used.
In the next chapter, we will look at the final piece of the protocol-oriented puzzle: Generics.
Read now
Unlock full access