SlideShare a Scribd company logo
ReactiveCocoa
Operators
Hai Feng Kao
1
Quiz 1
What does MVVM stand for?
2
Quiz2
What are the advantages of MVVM?
3
Quiz 3
What is the speaker’s name?
4
ReactiveCocoa
Operators
Hai Feng Kao
5
Hot n Cold
• Hot Signal
• sends values regardless of
whether it has any
subscribers
• but only send values after
their their subscription time.
• Cold Signal
• defers its work and the
sending of any values until it
has a subscriber 6
Cold Signal Example
7
Hot Signal Example
8
map
9
filter
10
take
11
skip
12
skip
• RACObserve sends the current value
immediately
13
distinctUntilChanged
14
merge
15
then
16
RACSubject
17
combineLatest:reduce:
18
zip:reduce:
19
Hot n Cold
• Hot Signal
• sends values regardless of
whether it has any subscribers
• but only send values after their
their subscription time.
• Cold Signal
• defers its work and the sending
of any values until it has a
subscriber
20
Cold Signal Example
21
replay
22
replayLast
23
replayLazily
24
replay (another example)
25
replayLazily (another example)
same as replay
26
replayLast (another example)
27
Next Class
28
Q&A
Thank you
29

More Related Content

Viewers also liked

ReactiveCocoa in Practice
ReactiveCocoa in PracticeReactiveCocoa in Practice
ReactiveCocoa in Practice
Outware Mobile
 
Learn You a ReactiveCocoa for Great Good
Learn You a ReactiveCocoa for Great GoodLearn You a ReactiveCocoa for Great Good
Learn You a ReactiveCocoa for Great Good
Jason Larsen
 
ReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of IIReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of II
manuelmaly
 
不能說的Dependency injection
不能說的Dependency injection不能說的Dependency injection
不能說的Dependency injection
Hai Feng Kao
 
Cocoapods多人協做
Cocoapods多人協做Cocoapods多人協做
Cocoapods多人協做
Hai Feng Kao
 
Reactive Cocoa Unknown Frontier
Reactive Cocoa Unknown FrontierReactive Cocoa Unknown Frontier
Reactive Cocoa Unknown Frontier
Hai Feng Kao
 
Reactive cocoa 101
Reactive cocoa 101Reactive cocoa 101
Reactive cocoa 101
Hai Feng Kao
 
Reactive Cocoa && MVVM
Reactive Cocoa && MVVMReactive Cocoa && MVVM
Reactive Cocoa && MVVM
Hai Feng Kao
 
CGRectDivide(everything)
CGRectDivide(everything)CGRectDivide(everything)
CGRectDivide(everything)
manuelmaly
 
Intro to ReactiveCocoa
Intro to ReactiveCocoaIntro to ReactiveCocoa
Intro to ReactiveCocoa
kleneau
 
105-2 iOS程式設計(四)
105-2 iOS程式設計(四)105-2 iOS程式設計(四)
105-2 iOS程式設計(四)
Hao Lee
 

Viewers also liked (11)

ReactiveCocoa in Practice
ReactiveCocoa in PracticeReactiveCocoa in Practice
ReactiveCocoa in Practice
 
Learn You a ReactiveCocoa for Great Good
Learn You a ReactiveCocoa for Great GoodLearn You a ReactiveCocoa for Great Good
Learn You a ReactiveCocoa for Great Good
 
ReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of IIReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of II
 
不能說的Dependency injection
不能說的Dependency injection不能說的Dependency injection
不能說的Dependency injection
 
Cocoapods多人協做
Cocoapods多人協做Cocoapods多人協做
Cocoapods多人協做
 
Reactive Cocoa Unknown Frontier
Reactive Cocoa Unknown FrontierReactive Cocoa Unknown Frontier
Reactive Cocoa Unknown Frontier
 
Reactive cocoa 101
Reactive cocoa 101Reactive cocoa 101
Reactive cocoa 101
 
Reactive Cocoa && MVVM
Reactive Cocoa && MVVMReactive Cocoa && MVVM
Reactive Cocoa && MVVM
 
CGRectDivide(everything)
CGRectDivide(everything)CGRectDivide(everything)
CGRectDivide(everything)
 
Intro to ReactiveCocoa
Intro to ReactiveCocoaIntro to ReactiveCocoa
Intro to ReactiveCocoa
 
105-2 iOS程式設計(四)
105-2 iOS程式設計(四)105-2 iOS程式設計(四)
105-2 iOS程式設計(四)
 

Reactive Cocoa Operators