$30 off During Our Annual Pro Sale. View Details »
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
0
160
Introducing the iOS Responder Chain
Presented at Brisbane Cocoaheads, October 2015
lachlanroche
October 06, 2015
Tweet
Share
More Decks by lachlanroche
See All by lachlanroche
iPad Multitasking in iOS9
lachlanroche
0
170
Xcode keyboard tips
lachlanroche
1
51
Xcode build script tips
lachlanroche
0
73
Introducing Datomic
lachlanroche
0
63
Introducing Xamarin
lachlanroche
0
64
Other Decks in Programming
See All in Programming
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.7k
Basic Architectures
denyspoltorak
0
120
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
590
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
170
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
150
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
170
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
280
Grafana:建立系統全知視角的捷徑
blueswen
0
220
AIコーディングエージェント(skywork)
kondai24
0
200
マスタデータ問題、マイクロサービスでどう解くか
kts
0
130
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
210
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
110
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
It's Worth the Effort
3n
187
29k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
260
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
75
How STYLIGHT went responsive
nonsquared
100
6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
49
Being A Developer After 40
akosma
91
590k
HDC tutorial
michielstock
0
270
Designing Powerful Visuals for Engaging Learning
tmiket
0
190
Chasing Engaging Ingredients in Design
codingconduct
0
84
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