Protocols
suggest changeIntroduction
Protocols are a way of specifying how to use an object. They describe a set of properties and methods which a class, structure, or enum should provide, although protocols pose no restrictions on the implementation.
Remarks
A Swift protocol is a collection of requirements that conforming types must implement. The protocol may then be used in most places where a type is expected, for example Arrays and generic requirements.
Protocol members always share the same access qualifier as the whole protocol, and cannot be specified separately. A protocol can still limit a requirement to a getter, or require both a getter and a setter, with { get } and { get set }.
For more information about protocols, see The Swift Programming Language.
Objective-C protocols are similar to Swift protocols.
Protocols are also comparable to Java interfaces.