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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
240
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
170
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
AIとRubyの静的型付け
ukin0k0
0
530
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
440
Swiftのレキシカルスコープ管理
kntkymt
0
210
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
420
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.4k
Inside Stream API
skrb
1
620
JavaDoc 再入門
nagise
0
260
Featured
See All Featured
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Test your architecture with Archunit
thirion
1
2.3k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Code Review Best Practice
trishagee
74
20k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
My Coaching Mixtape
mlcsv
0
140
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
560
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
240
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
30 Presentation Tips
portentint
PRO
1
310
Raft: Consensus for Rubyists
vanstee
141
7.5k
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