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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
lachlanroche
October 06, 2015
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
200
Xcode keyboard tips
lachlanroche
1
60
Xcode build script tips
lachlanroche
0
86
Introducing Datomic
lachlanroche
0
110
Introducing Xamarin
lachlanroche
0
82
Other Decks in Programming
See All in Programming
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
650
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.6k
今さら聞けない .NET CLI
htkym
0
180
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.6k
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
150
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
210
Go 1.27 における memory allocation の高速化
andpad
0
120
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
600
yield再入門 #phpcon
o0h
PRO
0
990
その節約、円になってますか?
isamumumu
1
710
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
260
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
340
Unsuck your backbone
ammeep
672
58k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
So, you think you're a good person
axbom
PRO
2
2.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
The SEO identity crisis: Don't let AI make you average
varn
0
530
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
380
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