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
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
57
Xcode build script tips
lachlanroche
0
79
Introducing Datomic
lachlanroche
0
83
Introducing Xamarin
lachlanroche
0
73
Other Decks in Programming
See All in Programming
Angular Signal Forms
debug_mode
0
110
感情を設計する
ichimichi
5
1.5k
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
230
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
170
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
220
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
790
Coding as Prompting Since 2025
ragingwind
0
840
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.5k
Programming with a DJ Controller — not vibe coding
m_seki
3
140
PHPer、Cloudflare に引っ越す
suguruooki
1
100
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
140
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
150
Featured
See All Featured
Everyday Curiosity
cassininazir
0
200
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
260
The Curse of the Amulet
leimatthew05
1
11k
Designing for humans not robots
tammielis
254
26k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
The SEO identity crisis: Don't let AI make you average
varn
0
450
Documentation Writing (for coders)
carmenintech
77
5.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Thoughts on Productivity
jonyablonski
76
5.1k
The agentic SEO stack - context over prompts
schlessera
0
760
How GitHub (no longer) Works
holman
316
150k
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