Now, we want to declare a
PartyWithDeeJayProtocol protocol and make the generic
PartyWithDeeJay<AnimalElement, DeeJayElement> class conform to this new protocol. We will make this protocol inherit from the previously created
PartyProtocol that defined a
MemberType associated type. Thus, the
PartyWithDeeJayProtocol protocol will inherit this associated type. We have to specify another associated type that will be specified during the protocol implementation, that is, when we declare the class that conforms to the new protocol.
The following lines show the declaration of the
PartyWithDeeJayProtocol protocol that inherits from the
PartyProtocol protocol. We must declare the protocol before the ...