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
170
0
Share
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
190
Xcode keyboard tips
lachlanroche
1
58
Xcode build script tips
lachlanroche
0
83
Introducing Datomic
lachlanroche
0
100
Introducing Xamarin
lachlanroche
0
78
Other Decks in Programming
See All in Programming
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
440
ふつうのFeature Flag実践入門
irof
7
3.5k
OSもどきOS
arkw
0
400
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.3k
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
470
AIエージェントの隔離技術の徹底比較
kawayu
0
460
さぁV100、メモリをお食べ・・・
nilpe
0
130
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
エージェンティックRAGにAWSで入門しよう!
har1101
5
120
今さら聞けないCancellationToken
htkym
0
220
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
270
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
830
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
160
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
250
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
130
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Odyssey Design
rkendrick25
PRO
2
670
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
930
How to build a perfect <img>
jonoalderson
1
5.6k
Facilitating Awesome Meetings
lara
57
6.9k
Rails Girls Zürich Keynote
gr2m
96
14k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
840
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