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
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
59
Xcode build script tips
lachlanroche
0
83
Introducing Datomic
lachlanroche
0
110
Introducing Xamarin
lachlanroche
0
78
Other Decks in Programming
See All in Programming
1B+ /day規模のログを管理する技術
broadleaf
0
110
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
260
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
100
A2UI という光を覗いてみる
satohjohn
1
150
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
280
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
410
Inside Stream API
skrb
1
770
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
150
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
AIだと陥りがちなJakarta EE最新技術への移行時の落とし穴と解決策
tnagao7
0
120
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
230
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
620
Typedesign – Prime Four
hannesfritz
42
3.1k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
340
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
Claude Code のすすめ
schroneko
67
230k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Scaling GitHub
holman
464
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
220
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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