Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introducing the iOS Responder Chain
Search
lachlanroche
October 06, 2015
Programming
190
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
210
Xcode keyboard tips
lachlanroche
1
70
Xcode build script tips
lachlanroche
0
91
Introducing Datomic
lachlanroche
0
120
Introducing Xamarin
lachlanroche
0
93
Other Decks in Programming
See All in Programming
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
Seven New Principles of Software Engineering
yegor256
0
350
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
4
1.3k
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
130
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
1.2k
最近”作らせてる” ローカルAIアプリの話
akit37
0
500
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
130
Railsバージョンを4倍にした話
optim
0
810
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.8k
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
130
No More NoSuchMethodError
exoego
1
120
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
960
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
630
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
47k
Automating Front-end Workflow
addyosmani
1370
210k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Building Applications with DynamoDB
mza
96
7.3k
Paper Plane
katiecoart
PRO
5
54k
Tell your own story through comics
letsgokoyo
1
1.1k
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