The Responder Chain
In Chapter 5, we talked briefly about UIResponder and the first responder. A UIResponder can receive touch events. UIView is one example of a UIResponder subclass, but there are many others, including UIViewController, UIApplication, and UIWindow. You are probably thinking, “But you can’t touch a UIViewController. It’s not an on-screen object!” You are right – you can’t send a touch event directly to a UIViewController, but view controllers can receive events through the responder chain. (By the way, you get two bonus points for keeping the view controller and its view separate in your brain.)
Every UIResponder has a pointer called nextResponder, and together these objects make up the responder chain shown in Figure 20.4 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access