Protocols are used to define a set of methods and properties independently of a class. Any class can adopt a protocol, which means that the class implements the properties and methods defined by the protocol. In effect, protocols define a contract that classes can agree to fulfill. When a class adopts a protocol, you can be confident that the class will have implemented the properties and methods in the protocol.
To use protocols, you must start by defining the protocol. Use the @protocol keyword to start defining the protocol. You can simply include this in the same file as the class ...