DevPrep

All topics › UIKit

What is the responder chain?

Middle PRO

The gist

The responder chain is a linked list of UIResponder objects through which an event climbs until someone handles it. Each responder either handles the event or passes it to its next responder. The order: view → its superview → … → if the view is a controller's view, the controller itself → the superview of the controller's view (or the presenting controller) → UIWindow → UIWindowScene → UIApplication → AppDelegate (which is also a UIResponder).

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store