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
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
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
180
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
380
Fragmented Architectures
denyspoltorak
0
130
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
150
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
1.2k
Implementation Patterns
denyspoltorak
0
260
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
350
Deno Tunnel を使ってみた話
kamekyame
0
350
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
180
ゆくKotlin くるRust
exoego
1
210
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
250
クラウドに依存しないS3を使った開発術
simesaba80
0
230
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Typedesign – Prime Four
hannesfritz
42
2.9k
Claude Code のすすめ
schroneko
67
210k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
42
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
110
How to make the Groovebox
asonas
2
1.9k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.5k
GitHub's CSS Performance
jonrohan
1032
470k
Amusing Abliteration
ianozsvald
0
87
Building Adaptive Systems
keathley
44
2.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.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