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
16k
Fluxで複雑な状態の変化を予測可能にするiOSアプリ開発
yonekawa
9
19k
ネイティブアプリでもFluxしたい
yonekawa
0
2.1k
freeeモバイルチームの変遷と進化
yonekawa
0
7.4k
RAC用クラス拡張の作り方
yonekawa
2
2.9k
Dive into Joybox
yonekawa
5
1.7k
Other Decks in Programming
See All in Programming
CSC509 Lecture 12
javiergs
PRO
0
160
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
C++でシェーダを書く
fadis
6
4.1k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
RubyLSPのマルチバイト文字対応
notfounds
0
120
イベント駆動で成長して委員会
happymana
1
320
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
900
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
初めてDefinitelyTypedにPRを出した話
syumai
0
400
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Featured
See All Featured
Designing for Performance
lara
604
68k
The Language of Interfaces
destraynor
154
24k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Speed Design
sergeychernyshev
24
610
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Code Review Best Practice
trishagee
64
17k
We Have a Design System, Now What?
morganepeng
50
7.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Done Done
chrislema
181
16k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Agile that works and the tools we love
rasmusluckow
327
21k
The Invisible Side of Design
smashingmag
298
50k
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ͱ͔Ͱ͖Δͷָͦ͏ͩͬͨ • υΩϡϝϯτແ͠Ͱ͍ํΛ୳Δͷ͍͠