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
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.6k
クラウドに依存しないS3を使った開発術
simesaba80
0
220
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
360
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
520
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
210
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
620
Go コードベースの構成と AI コンテキスト定義
andpad
0
160
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
39k
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
1k
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
5.2k
はじめてのカスタムエージェント【GitHub Copilot Agent Mode編】
satoshi256kbyte
0
160
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2.1k
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
51
Embracing the Ebb and Flow
colly
88
4.9k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
120
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
280
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
290
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
98
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
How to Ace a Technical Interview
jacobian
281
24k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
140
HDC tutorial
michielstock
1
320
Design in an AI World
tapps
0
120
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
230
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