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.