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
いまさらですがRxSwiftつかってみました
Search
Tsuyoshi Yonemoto
March 22, 2017
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
いまさらですが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
780
WebとiOSの連携方法は何がベストか? 2016年版 #potatotips 27
yoneapp
0
3.1k
Other Decks in Programming
See All in Programming
ActionController meets Protocol Buffers
sorah
0
300
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
2
1.9k
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
110
すこし踏み込む CancellationToken
htkym
2
1.7k
カツオ、ご期待ください
suneo3476
0
180
R8 の設定見直しでアプリサイズ削減
andpad
0
210
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.4k
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
120
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
最近”作らせてる” ローカルAIアプリの話
akit37
0
460
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
370
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Navigating Weather and Climate Data
rabernat
0
550
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
A Tale of Four Properties
chriscoyier
163
24k
How to make the Groovebox
asonas
2
2.5k
Design in an AI World
tapps
1
350
So, you think you're a good person
axbom
PRO
2
2.2k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
580
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
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