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
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
受け取る人から提供する人になるということ
little_rubyist
0
250
Click-free releases & the making of a CLI app
oheyadam
2
120
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
CSC509 Lecture 11
javiergs
PRO
0
180
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
110
RubyLSPのマルチバイト文字対応
notfounds
0
120
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Making Projects Easy
brettharned
115
5.9k
Building Applications with DynamoDB
mza
90
6.1k
Optimizing for Happiness
mojombo
376
70k
Why Our Code Smells
bkeepers
PRO
334
57k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Designing for humans not robots
tammielis
250
25k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
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ͱ͔Ͱ͖Δͷָͦ͏ͩͬͨ • υΩϡϝϯτແ͠Ͱ͍ํΛ୳Δͷ͍͠