reactive-cocoa-4

Why doesn't SignalProducer return a Signal?

天涯浪子 提交于 2019-12-07 01:09:22
问题 I feel like I understand all of the basic components of ReactiveCocoa (conceptually), by understanding how to connect all of the pieces together is still a bit confusing. For example, after reading about Signal, I fully expected SignalProducer to just have one start() method which returned a Signal, which you would use like so: mySignalProducer.start().observe(myObserver) Instead, you have to pass an observer into start(), and SignalProducer calls observe() for you: mySignalProducer.start

Why doesn't SignalProducer return a Signal?

℡╲_俬逩灬. 提交于 2019-12-05 05:44:44
I feel like I understand all of the basic components of ReactiveCocoa (conceptually), by understanding how to connect all of the pieces together is still a bit confusing. For example, after reading about Signal, I fully expected SignalProducer to just have one start() method which returned a Signal, which you would use like so: mySignalProducer.start().observe(myObserver) Instead, you have to pass an observer into start(), and SignalProducer calls observe() for you: mySignalProducer.start(myObserver) This means that the interface of SignalProducer is much larger (more to understand), because