Pitfalls of protocol extensions

Swift protocols are an incredibly powerful language feature, allowing us to define a blueprint of methods, properties, and other requirements that suit a particular piece of functionality. It's also possible to extend protocols to implement default behavior or add additional functionality. In this post, Dmitrii Ivanov examines protocol extensions, presenting what he thinks are some drawbacks of using this language feature.

How to declare Swift protocol for a specific class

Protocols enable us to define a blueprint of methods and properties suited to a particular task. Classes, structures, and enums can then adopt protocols and provide their implementation of those methods and properties. With Swift 5, protocol definitions can constrain their conforming types to those that subclass a particular class. In this post, Sarun Wongpatcharapakorn describes how to add such a constraint and explains the benefits of doing so.