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
180
Xcode keyboard tips
lachlanroche
1
51
Xcode build script tips
lachlanroche
0
74
Introducing Datomic
lachlanroche
0
66
Introducing Xamarin
lachlanroche
0
66
Other Decks in Programming
See All in Programming
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
Fluid Templating in TYPO3 14
s2b
0
130
CSC307 Lecture 02
javiergs
PRO
1
780
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
460
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
今から始めるClaude Code超入門
448jp
8
8.9k
並行開発のためのコードレビュー
miyukiw
0
260
Featured
See All Featured
HDC tutorial
michielstock
1
380
It's Worth the Effort
3n
188
29k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Designing for humans not robots
tammielis
254
26k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
310
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
A Soul's Torment
seathinner
5
2.3k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
76
First, design no harm
axbom
PRO
2
1.1k
Thoughts on Productivity
jonyablonski
74
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