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
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
60
Introducing Xamarin
lachlanroche
0
62
Other Decks in Programming
See All in Programming
ゼロダウンタイムでミドルウェアの バージョンアップを実現した手法と課題
wind111
0
200
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
110
CSC509 Lecture 10
javiergs
PRO
0
180
Chart.jsで長い項目を表示するときのハマりどころ
yumechi
0
130
Flutterチームから作る組織の越境文化
findy_eventslides
0
480
2026年向け会社紹介資料
misu
0
240
FlutterKaigi 2025 システム裏側
yumnumm
0
1.1k
TVerのWeb内製化 - 開発スピードと品質を両立させるまでの道のり
techtver
PRO
3
1.1k
Module Harmony
petamoriken
2
480
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
1.2k
Verilator + Rust + gRPC と Efinix の RISC-V でAIアクセラレータをAIで作ってる話 RTLを語る会(18) 2025/11/08
ryuz88
0
360
AI 時代だからこそ抑えたい「価値のある」PHP ユニットテストを書く技術 #phpconfuk / phpcon-fukuoka-2025
shogogg
1
570
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
6.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
4 Signs Your Business is Dying
shpigford
186
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Mobile First: as difficult as doing things right
swwweet
225
10k
GitHub's CSS Performance
jonrohan
1032
470k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
36
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Building Applications with DynamoDB
mza
96
6.8k
Typedesign – Prime Four
hannesfritz
42
2.9k
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