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
いまさらですがRxSwiftつかってみました
Search
Tsuyoshi Yonemoto
March 22, 2017
Programming
0
170
いまさらですがRxSwiftつかってみました
https://potatotips.connpass.com/event/50155/
で発表した発表資料です。
アプリに実際にRxSwiftを使ってみた事をまとめました。
Tsuyoshi Yonemoto
March 22, 2017
Tweet
Share
More Decks by Tsuyoshi Yonemoto
See All by Tsuyoshi Yonemoto
Serverless Frameworkを試してみたよ
yoneapp
1
770
WebとiOSの連携方法は何がベストか? 2016年版 #potatotips 27
yoneapp
0
3k
Other Decks in Programming
See All in Programming
CSC307 Lecture 10
javiergs
PRO
1
660
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
440
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
CSC307 Lecture 08
javiergs
PRO
0
670
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
ぼくの開発環境2026
yuzneri
0
240
Fluid Templating in TYPO3 14
s2b
0
130
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
Oxlint JS plugins
kazupon
1
1k
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AI & Enginnering
codelynx
0
120
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
77
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Claude Code のすすめ
schroneko
67
210k
The agentic SEO stack - context over prompts
schlessera
0
650
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
WCS-LA-2024
lcolladotor
0
450
The Language of Interfaces
destraynor
162
26k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
67
Transcript
͍·͞ΒͰ͕͢ RxSwift͔ͭͬͯΈ·ͨ͠ potatotips #38 @yoneapp Tsuyoshi Yonemoto
@yoneapp • ̎̌̍̎ɿελʔτΞοϓͷڞಉۀऀ • ̎̌̍̑ɿiOS & RailsϑϦʔϥϯε
ΞϓϦ͕ग़·ͨ͠ʂʢ̍ʣ
ΞϓϦ͕ग़·ͨ͠ʂʢ̎ʣ
RxSwiftΛͬͯΈ·ͨ͠
PRESS BLOGͰͷࣄྫ
PRESSͷॳճىಈ
PUSH௨τʔΫϯͷڞ༗ • ΩʔΛૹΔʹϩάΠϯೝূใ͕ඞཁ • PUSH௨τʔΫϯͷऔಘλΠϛϯά • ॳճঝೝ࣌ • ઃఆ͔Βঝೝ͞Ε͔ͯΒΞΫςΟϒ •
γεςϜతʹมߋʁ • ผΞΧϯτͰϩάΠϯ͞ΕͨΒͲ͏͢Δ
ෳࡶͩͳʔ
RxSwiftΛͬͯΈΑ͏
࣮ࡍͷίʔυ let sessionId = Session.shared.sessionId.asObservable().unwrap() let pushToken = pushTokenObservable.unwrap() Observable.combineLatest(sessionId,
pushToken) { PushTokenUpdateRequest(sessionId:$0, pushToken: $1) } .subscribe(onNext: { _ = $0.post() }) .addDisposableTo(disposeBag) ※ unwrap(RxSwiftExt)nilΛফ͢
࣮ࡍͷίʔυ OneSignal.idsAvailable { (playerId, pushToken) in self.pushTokenObservable.onNext(pushToken) }
࣮ࡍͷίʔυ class Session { static let shared = Session() var
sessionId: Variable<String?> }
RxSwift ঢ়ଶΛมͱͯ͠ఆٛͰ͖Δͱཧղͨ͠
ෳࡶͳΛղܾͰ͖ͨ let sessionId = Session.shared.sessionId.asObservable().unwrap() let pushToken = pushTokenObservable.unwrap() Observable.combineLatest(sessionId,
pushToken) { PushTokenUpdateRequest(sessionId:$0, pushToken: $1) } .subscribe(onNext: { _ = $0.post() }) .addDisposableTo(disposeBag) ※ unwrap(RxSwiftExt)nilΛফ͢
࣮ͯ͠Έͯ…
pausableBuffered http://rxmarbles.com/#pausableBuffered
RxSwiftʹແ͍
ແ͍ͷ͋Δ http://reactivex.io/documentation/operators/backpressure.html
Observable.combineLatest http://rxmarbles.com/#combineLatest
unwrap(RxSwiftExt) https://github.com/RxSwiftCommunity/RxSwiftExt#unwrap
ͬͱRxSwiftΛ͍͜ͳ͠ ͯૉఢͳΞϓϦΛ࡞Γ·͢
END