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
81
Introducing Datomic
lachlanroche
0
95
Introducing Xamarin
lachlanroche
0
77
Other Decks in Programming
See All in Programming
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
600
Firefoxにコントリビューションして得られた学び
ken7253
2
160
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
23
13k
Making the RBS Parser Faster
soutaro
0
720
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
460
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
120
Sans tests, vos agents ne sont pas fiables
nabondance
0
120
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
930
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.2k
GoogleCloudとterraform完全に理解した
terisuke
1
200
Agentic Elixir
whatyouhide
0
450
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
180
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
250
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
510
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Raft: Consensus for Rubyists
vanstee
141
7.4k
We Are The Robots
honzajavorek
0
230
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Design in an AI World
tapps
1
210
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
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