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
古き良きsendAction (in potatotips #26)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
tokorom
February 17, 2016
Technology
1
3.8k
古き良きsendAction (in potatotips #26)
UIApplicationのsendActionを見直そう
tokorom
February 17, 2016
Tweet
Share
More Decks by tokorom
See All by tokorom
CursorでアプリをBuild/Lint
tokorom
0
240
続・SharePlayの歴史と進化 iOS18とApple Vision Proにおける新展開
tokorom
3
1.1k
SharePlayの歴史と進化 そしてvisionOSへ (iOSDC 2023)
tokorom
3
1.2k
5分でSharePlay入門
tokorom
3
1.6k
HomeKit 2020
tokorom
7
2.8k
Advanced Segue 2019年のSegue事情
tokorom
9
6.3k
tvOSアプリUIの勘所
tokorom
1
2.4k
カッコ悪くリアクティブじゃダメですか?
tokorom
7
13k
画面遷移と私(iOS)
tokorom
4
3.9k
Other Decks in Technology
See All in Technology
Datadog の RBAC のすべて
nulabinc
PRO
3
420
情シスのための生成AI実践ガイド2026 / Generative AI Practical Guide for Business Technology 2026
glidenote
0
180
越境する組織づくり ─ 多様性を前提にしたチームビルディングとリードの実践知
kido_engineer
2
170
OpenClawで回す組織運営
jacopen
3
670
IBM Bobを使って、PostgreSQLのToDoアプリをDb2へ変換してみよう/202603_Dojo_Bob
mayumihirano
1
300
Agentic Software Modernization - Back to the Roots (Zürich Agentic Coding and Architectures, März 2026)
feststelltaste
1
230
聲の形にみるアクセシビリティ
tomokusaba
0
160
管理者向けGitHub Enterpriseの運用Tips紹介: 人にもAIにも優しいプラットフォームづくり
yuriemori
0
190
「ストレッチゾーンに挑戦し続ける」ことって難しくないですか? メンバーの持続的成長を支えるEMの環境設計
sansantech
PRO
3
570
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
5
1.1k
[AEON TECH HUB #24] お客様の長期的興味の理解に向けて
alpicola
0
130
[JAWS DAYS 2026]私の AWS DevOps Agent 推しポイント
furuton
0
130
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
250
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
120
Practical Orchestrator
shlominoach
191
11k
Typedesign – Prime Four
hannesfritz
42
3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
120
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
200
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Scaling GitHub
holman
464
140k
Navigating Team Friction
lara
192
16k
Transcript
ݹ͖ྑ͖ sendAction ॴ ༑ଠ @tokorom iOS App Programer potatotips-26
ॴ༑ଠ @tokorom (ϑϦʔλʔʣ potatotipsӡӦ૭ޱ / potatotipsΛओ࠵͍͚ͨͩΔձࣾ͞Μืूதʂ
UIApplication - sendAction
UIApplication - sendAction •࣮ࡍʹ͍ͬͯΔਓͲͷ͘Β͍ʁ •ͦͦଘࡏΛ͍ͬͯΔʁ •ʢUIControlͷ΄͏ͨ·ʹݟΔ͚Ͳ…ʣ •ʢ͍ͬͯΔͷΛ͋Μ·Γݟͨ͜ͱͳ͍ʣ
UIApplication - sendAction NEW! iOS 9 Ͱ ྲྀ ͷ͝ͱ͘ݱΕͨ ࠷ڧ
ͷ function !?
UIApplication - sendAction iPhone OS 2 ͔Β ͘͝ ී௨ ʹଘࡏ͢Δ
͋·Γ ΘΕͳ͍ ͭ
// hoge: ΛൃՐ let app = UIApplication.sharedApplication() app.sendAction("hoge:", to: xxx,
from: sender, forEvent: nil) // hoge: func hoge(sender: AnyObject) { print("hoge!!") } αϯϓϧίʔυ UIApplication - sendAction
UIApplication - sendAction •ग़ͨΑɺจࣈྻࢦఆʂ •Objective-C෩selectorࢦఆ͕ݹष͍ •͍ॴ͋Δͷʁ •RxSwiftͱ͔͏΄͏͕Α͘ͳ͍ʁ app.sendAction("hoge:", to: xxx,
from: sender, forEvent: nil) ͓͓ΉͶ ਖ਼ղ
Responder Chain (in UIKit)
Responder Chain (in UIKit) •Ԟ·ͬͨ֊ͰൃՐ •֊ͷͲ͜Ͱड͚ΒΕΔ •DelegateͷΑ͏ʹreceiverΛड͚ ͢ඞཁ͕ͳ͍ •ଞखஈͰಉ͡ߏΛ࣮ݱ͢Δͷ ͍͠
Responder Chain (in UIKit) app.sendAction("hoge:", to: xxx, from: sender, forEvent:
nil) app.sendAction("hoge:", to: , from: sender, forEvent: nil) app.sendAction("hoge:", to: nil, from: sender, forEvent: nil)
Responder Chain (in UIKit) UITabBarController UIViewController UITabBarController UIViewController UIViewController UIViewController
Responder Chain (in UIKit) UITabBarController UIViewController UITabBarController UIViewController UIViewController UIViewController
UITableView UITableViewCell UIView UIButton
sendActionͷྑ͍ͱ͜Ζ •Responder Chainͳૄ݁߹ͳΈͰը໘ߏ ͕มΘͬͯར༻Ͱ͖Δ •CocoaͷࠜװͱͳΔΈͷͨΊྲྀߦʹࠨӈ͞ Εͳ͍
sendActionͷμϝͳͱ͜Ζ •ΠϯλʔϑΣʔε͕ݹ͍ •จࣈྻࢦఆ •selector?? •ҾʹಛఆͷObjectΛͮ͠Β͍
৽͍͠ΠϯλʔϑΣʔεͰϥοϐϯά // hoge: ΛൃՐ HogeEvent(hoge: hoge).fireFrom(self.view) // hoge: func hoge(sender:
AnyObject) { guard let hoge: Hoge =ɹContext.valueFor(sender) else { return } print("hoge: \(hoge)") }
·ͱΊ •UIApplicationͷsendAction߹ʹΑͬͯ༗ ༻ •ݹ͖ྑ͖ػೳ͕ͩը໘ߏ͕ෳࡶͳݱͰͦ͜ ར༻Ձ͕͋Δ •ੲ͔Β͋Δػೳʹҙ֎ͱ͑Δͷ͕ͬͯ ͍Δ͔ʁ
More Information Yuta ToKoRo iOS App Programer Twitter @tokorom http://www.tokoro.me/