Chapter 7. Protocols

 

This chapter covers
  • Protocol overview
  • Defining protocols
  • Conforming to a protocol
  • Looking at examples of commonly used protocols

 

Now that you have some experience creating standard and custom objects, you need to look at how these objects interact. If two objects are to work together, you need to make sure they know how to talk to each other. For objects to talk to each other, they need to know what conversation they’re having. The conversation between objects is usually represented by the protocol design scheme.

Sometimes when you create a class, you design it to be used as a tool for some other class. If you’re going to do this, two things must be in place. First, your object must have a way to send callbacks ...

Get Objective-C Fundamentals now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.