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
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
180
Xcode keyboard tips
lachlanroche
1
51
Xcode build script tips
lachlanroche
0
74
Introducing Datomic
lachlanroche
0
66
Introducing Xamarin
lachlanroche
0
66
Other Decks in Programming
See All in Programming
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
980
今から始めるClaude Code超入門
448jp
7
8.3k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
Data-Centric Kaggle
isax1015
2
760
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
290
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
680
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
130
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.7k
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
160
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
240
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
The Curse of the Amulet
leimatthew05
1
8.2k
Paper Plane
katiecoart
PRO
0
46k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
Designing for humans not robots
tammielis
254
26k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
61
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