Protocols in Swift

A protocol defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality. The protocol can then be adopted by a class, structure, or enumeration to provide an actual implementation of those requirements. Any type that satisfies the requirements of a protocol is said to conform to that protocol.
 
In addition to specifying requirements that conforming types must implement, you can extend a protocol to implement some of these requirements or to implement additional functionality that conforming types can take advantage of.
 
Property requirements are always declared as variable properties, prefixed with the var keyword.
 
If you define a protocol instance method requirement that’s intended to mutate instances of any type that adopts the protocol, mark the method with the mutating keyword as part of the protocol’s definition.
 
Protocols can require specific initializers to be implemented by conforming types.
 
You can implement a protocol initializer requirement on a conforming class as either a designated initializer or a convenience initializer.
 
Protocols can define failable initializer requirements for conforming types, as defined in Failable Initializers.
Protocols don’t actually implement any functionality themselves. Nonetheless, you can use protocols as a fully fledged types in your code.
 
You can extend an existing type to adopt and conform to a new protocol, even if you don’t have access to the source code for the existing type.
 
A protocol can be used as the type to be stored in a collection such as an array or a dictionary.
 
A protocol can inherit one or more other protocols and can add further requirements on top of the requirements it inherits.
 
You can limit protocol adoption to class types (and not structures or enumerations) by adding the AnyObject protocol to a protocol’s inheritance list.
 
It can be useful to require a type to conform to multiple protocols at the same time. You can combine multiple protocols into a single requirement with a protocol composition.