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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
180
Xcode keyboard tips
lachlanroche
1
55
Xcode build script tips
lachlanroche
0
77
Introducing Datomic
lachlanroche
0
77
Introducing Xamarin
lachlanroche
0
70
Other Decks in Programming
See All in Programming
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
KagglerがMixSeekを触ってみた
morim
0
360
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
8
4.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.3k
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
20260315 AWSなんもわからん🥲
chiilog
2
180
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
310
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
200
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
300
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
320
おれのAgentic Coding 2026/03
tsukasagr
1
120
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
Ruling the World: When Life Gets Gamed
codingconduct
0
190
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
27
3.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
140
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
260
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Designing Powerful Visuals for Engaging Learning
tmiket
1
320
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
660
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