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
58
Xcode build script tips
lachlanroche
0
81
Introducing Datomic
lachlanroche
0
95
Introducing Xamarin
lachlanroche
0
77
Other Decks in Programming
See All in Programming
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
200
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
930
Are We Really Coding 10× Faster with AI?
kohzas
0
180
From Formal Specification to Property Based Test
ohbarye
0
2.6k
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
360
「なんか〇〇ライブラリで脆弱性あるみたいなんだけど。。。」から始める脆弱性対応 / First Steps in Vulnerability Response
mackey0225
2
130
空間オーディオの活用
objectiveaudio
0
150
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
440
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
160
AgentCore Optimizationを始めよう!
licux
3
240
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
150
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
Technical Leadership for Architectural Decision Making
baasie
3
360
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
340
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
290
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Docker and Python
trallard
47
3.8k
Making Projects Easy
brettharned
120
6.6k
Code Review Best Practice
trishagee
74
20k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
150
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
310
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
140
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