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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
0
290
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
650
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
110
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
130
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.5k
初めてのKubernetes 本番運用でハマった話
oku053
0
130
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
140
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
910
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
150
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
どこまでゆるくて許されるのか
tk3fftk
0
500
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
730
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
180
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
390
Tell your own story through comics
letsgokoyo
1
1k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
400
RailsConf 2023
tenderlove
30
1.5k
Side Projects
sachag
455
43k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
Ruling the World: When Life Gets Gamed
codingconduct
0
280
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