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
ReactiveCocoa Pitfalls at freee
Search
Kenichi Yonekawa
October 18, 2014
Programming
2
830
ReactiveCocoa Pitfalls at freee
10/18にfreeeで開催されたReactiveCocoa TokyoのLT資料です
http://connpass.com/event/8680/
http://www.freee.co.jp/
Kenichi Yonekawa
October 18, 2014
Tweet
Share
More Decks by Kenichi Yonekawa
See All by Kenichi Yonekawa
iOSアプリの設計とDependency Injection
yonekawa
22
17k
Fluxで複雑な状態の変化を予測可能にするiOSアプリ開発
yonekawa
9
19k
ネイティブアプリでもFluxしたい
yonekawa
0
2.2k
freeeモバイルチームの変遷と進化
yonekawa
0
7.5k
RAC用クラス拡張の作り方
yonekawa
2
2.9k
Dive into Joybox
yonekawa
5
1.7k
Other Decks in Programming
See All in Programming
rails newと同時に型を書く
aki19035vc
5
710
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
200
Scaling your build logic
antalmonori
1
100
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
Azure AI Foundryのご紹介
qt_luigi
1
210
HTML/CSS超絶浅い説明
yuki0329
0
190
asdf-ecspresso作って 友達が増えた話 / Fujiwara Tech Conference 2025
koluku
0
1.4k
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
Featured
See All Featured
Bash Introduction
62gerente
610
210k
The Invisible Side of Design
smashingmag
299
50k
4 Signs Your Business is Dying
shpigford
182
22k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Thoughts on Productivity
jonyablonski
68
4.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Done Done
chrislema
182
16k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
How GitHub (no longer) Works
holman
312
140k
GraphQLとの向き合い方2022年版
quramy
44
13k
Transcript
ReactiveCocoa Pitfalls at freee @yonekawa
freeeͷiOSΞϓϦ͕ ReactiveCocoaΛಋೖ͔ͯ͠ Β̕ϲ݄͕ܦͪ·ͨ͠
• 2014/12/20 iOSΞϓϦ։ൃணख • 2014/01/10 ReactiveCocoaಋೖ • 2014/02/14 1.0.0ϦϦʔε
ʹҰମԿ͕ɾɾɾ
ReactiveCocoaΛ͍ͬͯͯ freeeͰى͖ͨ ϋϚΓͲ͜ΖΛհ͠·͢ : ReactiveCocoaͷAPI͕ͪΐ͍ͪΐ͍ग़͖ͯ·͢
combineLatestWith
combineLatestWithͱSignalͷ࣮ߦॱ • combineLatestWithฒྻʹSignalΛ࣮ߦ͢Δ ͷͰൃՐ͞ΕΔॱংෆఆɻϩάΠϯ͔ͯ͠Βσʔ λΛऔಘɺΈ͍ͨͳॲཧʹ͏ͱϋϚΔ • ྻʹ͍ͨ࣌͠ʹflattenMapΛ͏
rac_textSignal
rac_textSignal vs RACObserve • textϓϩύςΟʹೖ͢ΔΑ͏ͳέʔεͰγ άφϧ͕ൃՐ͠ͳ͍ɻRACObserveͰtextϓϩύ ςΟΛsubscribe͢ΔͱൃՐ͢Δ • ٯʹΩʔϘʔυ͔ΒͷೖྗRACObserveͩͱൃՐ ͠ͳ͍ɻrac_textSignalͰऔΒͳ͍ͱ͍͚ͳ͍
• combineLatestͯ྆͠ํൃՐ͢ΔsignalΛ࡞ͬ ͨΓͨ͠
sendCompleted
None
sendErrorͷޙͷsendCompleted • sendErrorͷޙʹsendCompletedΛݺΜͰݺ Εͳ͍ɻ • subscribe͢ΔଆͰnextͱerrorͰڞ௨ͰΓͨ ͍ॲཧʢΠϯδέʔλΛࢭΊΔͱ͔ʣΛॻ͖͍ͨ࣌ ʹݸผʹॻ͔ͳ͍ͱ͍͚ͳ͍
[RACSignal empty]
None
[RACSignal empty] • RACSignalϕʔεͰΓऔΓ͍ͯ͠Δ࣌ɺ [RACSignal empty]Λฦ͢ͱવnexterrorൃ Ր͞Εͳ͍ • subscribeલʹΠϯδέʔλΛճͯ͠nextͱerrorͰ ࢭΊ͍ͯΔ߹ɺΠϯδέʔλ͕ճΓͬͺͳ͠ʹͳΔ
• empty͡Όͳۭͯ͘ͷ݁ՌΛฦ͢SignalΛฦ͢ͷ͕Α ͦ͞͏
UITableView
Cellͷதʹsubscribe͍ͨ͠View͕͋Δ࣌ • ηϧ͕࠶ར༻͞ΕΔͱೋॏʹϑΥʔ ϜͷΠϕϯτΛsubscribeͯ͠ ͠·͏ • reloadͳͲߟ͑Δͱ subscriberΛഁغ͢ΔλΠϛϯ ά͕͍͠ •
ݱঢ়ۤͷࡦͰ࠶ར༻ΊͨΓ ͯ͠Δ
ReactiveCocoa3.0
ReactiveCocoa3.0 • LTͷͨΊʹແͯ͠ಋೖ͠Α͏ͱௐͨ • طଘͷRACSignalϕʔεͷΠϯλϑΣʔεΛ asColdSignalͱ͔Ͱ͖Δͷָͦ͏ͩͬͨ • υΩϡϝϯτແ͠Ͱ͍ํΛ୳Δͷ͍͠