Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introducing the iOS Responder Chain
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
lachlanroche
October 06, 2015
Programming
170
0
Share
Introducing the iOS Responder Chain
Presented at Brisbane Cocoaheads, October 2015
lachlanroche
October 06, 2015
More Decks by lachlanroche
See All by lachlanroche
iPad Multitasking in iOS9
lachlanroche
0
190
Xcode keyboard tips
lachlanroche
1
58
Xcode build script tips
lachlanroche
0
83
Introducing Datomic
lachlanroche
0
100
Introducing Xamarin
lachlanroche
0
78
Other Decks in Programming
See All in Programming
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
2k
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1.1k
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
220
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
760
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
190
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
130
さぁV100、メモリをお食べ・・・
nilpe
0
130
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.4k
Lessons from Spec-Driven Development
simas
PRO
0
130
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
2
270
Moments When Things Go Wrong
aurimas
3
140
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Building an army of robots
kneath
306
46k
Ruling the World: When Life Gets Gamed
codingconduct
0
240
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
340
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
840
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
Utilizing Notion as your number one productivity tool
mfonobong
4
310
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Transcript
Introducing the Responder Chain Brisbane Cocoaheads Oct 2015 @lachlanroche
None
UIResponder • UIApplication • UIView (UIWindow) • UIViewController • SKNode
• AppDelegate in a new project
UIApplication + sendAction:to:from:forEvent • This is what gets called when
a wired up IBAction is triggered
to target: AnyObject? • “The object to receive the action
message. If to is nil, the app sends the message to the first responder, from whence it progresses up the responder chain until it is handled.” • First Responder in IB means target == nil
“…from whence it progresses up the responder chain until it
is handled.” • Initial receiver is the First Responder. • canPerformAction(_ action: Selector, withSender sender: AnyObject?) -> Bool • nextResponder() -> UIResponder?
None
Dismiss keyboard? • sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil
UITableViewCell • Works with UITableView to implement context menus. •
If you want to send an action via the responder chain, override canPerformAction:withSender:
Finding First Responder static __weak id currentFirstResponder; @implementation UIResponder (FirstResponder)
+ (id) currentFirstResponder { currentFirstResponder = nil; [[UIApplication sharedApplication] sendAction:@selector(findFirstResponder:) to:nil from:nil forEvent:nil]; return currentFirstResponder; } - (void) findFirstResponder:(id)sender { currentFirstResponder = self; } @end