December 2013
Intermediate to advanced
132 pages
1h 58m
English
CHAPTER 23
![]()
Protocols
Protocols Overview
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.
Defining Protocols
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 ...
Read now
Unlock full access