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
λ is coming to Obj-C – ReactiveCocoa
Search
Vladimir Burdukov
December 07, 2013
Programming
410
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
λ is coming to Obj-C – ReactiveCocoa
Vladimir Burdukov
December 07, 2013
More Decks by Vladimir Burdukov
See All by Vladimir Burdukov
Alice in robovacuum land
chipp
0
73
It’s time to migrate from RxSwift to Combine. Long story short
chipp
0
110
Decodable vs real-world JSON
chipp
0
92
`fastlane beta` 2 или почему я стал пить больше кофе
chipp
0
650
`fastlane beta` или почему я стал пить больше кофе
chipp
0
160
Архитектурные излишества в iOS приложениях Superjob
chipp
0
220
λ is coming to Obj-C – ReactiveCocoa
chipp
1
150
Build bots
chipp
0
130
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
300
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
160
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.9k
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
2
300
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
390
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
360
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
150
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.5k
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
120
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Test your architecture with Archunit
thirion
2
2.4k
Documentation Writing (for coders)
carmenintech
77
5.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Optimising Largest Contentful Paint
csswizardry
37
4k
First, design no harm
axbom
PRO
2
1.3k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
Transcript
λ is coming to Obj-C: ReactiveCocoa Vladimir @chippcheg Burdukov Lead
Hipster Developer at HiQo Solutions
State
Let’s enumerate NSMutableArray
Functional programming
Stateless
Stateless Composition
Stateless Composition Concurrency https://class.coursera.org/progfun-003/class http://twitter.github.io/scala_school/index.html
Composition
Composition package cocoaheads ! object cocoaheads { def fib(n: Int):
List[Int] = { def tail(n: Int, p: Int, m: Int): List[Int] = if (n == 1) List(p) else p :: tail(n - 1, m, p + m) tail(n, 1, 1) } //> fib: (n: Int)List[Int] fib(4) //> res0: List[Int] = List(1, 1, 2, 3) fib(4).zip(fib(4).map((x: Int) => x * x)) //> res1: List[(Int, Int)] = List((1,1), (1,1), (2,4), (3,9)) fib(4).foldLeft(0)((m: Int, n: Int) => m + n) //> res2: Int = 7 } http://bcomposes.wordpress.com/2011/08/20/fun-with- function-composition-in-scala/
Functional Programming
Functional Reactive Programming
Functional Reactive Programming
ReactiveCocoa Next step of Objective-C evolution https://github.com/ReactiveCocoa/ReactiveCocoa/
Introduction https://github.com/ReactiveCocoa/ReactiveCocoa/blob/master/ Documentation/
RACStream RACSequense RACSignal
RACSignal
RACSignal RACSignal *signal = [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) { if
(value) { [subscriber sendNext:value]; [subscriber sendCompleted]; } else { [subscriber sendError:error]; } return nil; }];
RACSignal [signal subscribeNext:^(id x) { NSLog(@"SIGNAL NEW VALUE: %@", x);
} error:^(NSError *error) { NSLog(@"SIGNAL ERROR: %@", error); } completed:^{ NSLog(@"SIGNAL COMPLETED"); }]; RACSignal *signal = [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) { if (value) { [subscriber sendNext:value]; [subscriber sendCompleted]; } else { [subscriber sendError:error]; } return nil; }];
RACSignal *loginEditingSignal = [[self.loginField rac_signalForControlEvents:UIControlEventEditingChanged] map:^id(UITextField *x) { return @(x.isEditing);
}]; ! RACSignal *passwordEditingSignal = [[self.passwordField rac_signalForControlEvents:UIControlEventEditingChanged] map:^id(UITextField *x) { return @(x.isEditing); }]; RAC(self.tapGestureRecognizer, enabled) = [RACSignal combineLatest:@[loginEditingSignal, passwordEditingSignal] reduce:^id(NSNumber *loginIsEditing, NSNumber *passwordIsEditing){ return @([loginIsEditing boolValue] || [passwordIsEditing boolValue]); }]; RACSignal Combining
RACSequence
RACSequence RACSequence *fib(int n) { return fibTail(n, 1, 1); }
! RACSequence *fibTail(int n, int p, int m) { return [RACSequence sequenceWithHeadBlock:^NSNumber *{ return @(p); } tailBlock:^RACSequence *{ if (n == 1) { return [RACSequence empty]; } else { return fibTail(n - 1, m, p + m); } }]; } ! NSLog(@"%@", fib(4).array); // [1, 1, 2, 3] ! NSLog(@"%@", [fib(4) zipWith:[fib(4) map:^NSNumber *(NSNumber *value) { return @([value integerValue] * [value integerValue]); }]].array); // [(1, 1), (1, 1), (2, 4), (3, 9)] ! NSLog(@"%@", [fib(4) foldLeftWithStart:@0 reduce:^NSNumber *(NSNumber *accumulator, NSNumber *value) { return @(accumulator.integerValue + value.integerValue); }]); // 7
RACDisposable
RACScheduler
Binding RAC(avatarImageView, image) = RACObserve(self.viewModel, userAvatar);
ReactiveCocoa UI extensions • UIActionSheet / UIAlertView • UIButton •
UITableViewCell • UIControl (rac_signalForControlEvents:) • UIGestureRecognizer • UITextField
Conclusion
Questions