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
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
83
Introducing Datomic
lachlanroche
0
100
Introducing Xamarin
lachlanroche
0
78
Other Decks in Programming
See All in Programming
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
220
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
2
270
3Dシーンの圧縮
fadis
1
590
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
440
net-httpのHTTP/2対応について
naruse
0
430
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
180
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
190
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
420
JavaDoc 再入門
nagise
0
260
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.5k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
360
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Building Adaptive Systems
keathley
44
3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
240
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
320
What's in a price? How to price your products and services
michaelherold
247
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Balancing Empowerment & Direction
lara
6
1.1k
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