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
57
Xcode build script tips
lachlanroche
0
79
Introducing Datomic
lachlanroche
0
83
Introducing Xamarin
lachlanroche
0
73
Other Decks in Programming
See All in Programming
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
150
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
220
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
640
Don't Prompt Harder, Structure Better
kitasuke
0
780
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
990
実践CRDT
tamadeveloper
0
590
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
150
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
570
AIと共に生きる技術選定 2026
sgash708
0
100
Back to the roots of date
jinroq
0
320
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
240
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.6k
Docker and Python
trallard
47
3.8k
How to Talk to Developers About Accessibility
jct
2
180
Building the Perfect Custom Keyboard
takai
2
730
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Ruling the World: When Life Gets Gamed
codingconduct
0
210
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
170
Embracing the Ebb and Flow
colly
88
5k
Designing for Performance
lara
611
70k
The Spectacular Lies of Maps
axbom
PRO
1
710
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