$30 off During Our Annual Pro Sale. View Details »
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
170
Xcode keyboard tips
lachlanroche
1
51
Xcode build script tips
lachlanroche
0
73
Introducing Datomic
lachlanroche
0
62
Introducing Xamarin
lachlanroche
0
64
Other Decks in Programming
See All in Programming
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.5k
Microservices rules: What good looks like
cer
PRO
0
1.6k
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
420
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
190
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.4k
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
200
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
440
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
160
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
780
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
250
Featured
See All Featured
How to make the Groovebox
asonas
2
1.8k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Become a Pro
speakerdeck
PRO
31
5.7k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
120
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
115
91k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
1
200
Discover your Explorer Soul
emna__ayadi
2
1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
39
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
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