Protocols declare an interface (methods and properties) that is expected to be used for a particular situation, independent of a particular class. Protocols are often used to either declare an interface that may have many different implementations (e.g. NSCoding
) or defer important implementation details to another object (e.g. UITableViewDataSource
).