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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tsuyoshi Yonemoto
March 22, 2017
Programming
180
0
Share
いまさらですがRxSwiftつかってみました
https://potatotips.connpass.com/event/50155/
で発表した発表資料です。
アプリに実際にRxSwiftを使ってみた事をまとめました。
Tsuyoshi Yonemoto
March 22, 2017
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
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
3.6k
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
220
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
450
KagglerがMixSeekを触ってみた
morim
0
360
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
200
AI 開発合宿を通して得た学び
niftycorp
PRO
0
180
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
290
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
AI活用のコスパを最大化する方法
ochtum
0
360
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
420
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
700
How to train your dragon (web standard)
notwaldorf
97
6.6k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
170
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
250
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
BBQ
matthewcrist
89
10k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Bash Introduction
62gerente
615
210k
Unsuck your backbone
ammeep
672
58k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
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