Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introducing the iOS Responder Chain
Search
lachlanroche
October 06, 2015
Programming
190
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
210
Xcode keyboard tips
lachlanroche
1
69
Xcode build script tips
lachlanroche
0
89
Introducing Datomic
lachlanroche
0
120
Introducing Xamarin
lachlanroche
0
86
Other Decks in Programming
See All in Programming
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
470
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
960
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
150
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
240
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.5k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
220
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
710
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
160
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
120
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
180
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
280
Featured
See All Featured
From π to Pie charts
rasagy
1
370
Optimizing for Happiness
mojombo
378
71k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
520
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
A designer walks into a library…
pauljervisheath
211
25k
Darren the Foodie - Storyboard
khoart
PRO
4
3.9k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
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