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
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
200
Xcode keyboard tips
lachlanroche
1
60
Xcode build script tips
lachlanroche
0
85
Introducing Datomic
lachlanroche
0
110
Introducing Xamarin
lachlanroche
0
81
Other Decks in Programming
See All in Programming
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.9k
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
130
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.9k
symfony/aiとlaravel/boost
77web
0
130
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
170
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.8k
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
110
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
5.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
The Invisible Side of Design
smashingmag
301
52k
The untapped power of vector embeddings
frankvandijk
2
1.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
200
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
Mind Mapping
helmedeiros
PRO
1
280
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
310
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