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
190
Xcode keyboard tips
lachlanroche
1
59
Xcode build script tips
lachlanroche
0
83
Introducing Datomic
lachlanroche
0
110
Introducing Xamarin
lachlanroche
0
78
Other Decks in Programming
See All in Programming
Contextとはなにか
chiroruxx
1
370
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
180
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
290
A2UI という光を覗いてみる
satohjohn
1
150
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.5k
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
2
750
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.4k
dRuby over BLE
makicamel
2
390
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
120
The NotImplementedError Problem in Ruby
koic
1
920
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
200
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Agile that works and the tools we love
rasmusluckow
331
22k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.5k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
380
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Navigating Team Friction
lara
192
16k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
370
How to make the Groovebox
asonas
2
2.2k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
860
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