We've already seen how protocols can be used to improve code by removing complex inheritance hierarchy. You also know how powerful it is to check for protocol conformance instead of checking whether a certain object is of a certain type. Let's see how we can improve and future-proof the HelloContacts application by adding some protocols.
We will define two protocols for now: one that specifies the requirements for any object that claims to be able to add a special animation to a view, and one that defines what it means to be able to be displayed as a contact.
The first protocol we will define will be called
ViewEffectAnimatorType. This protocol should be applied to any object ...