ReactiveCocoa的核心为signals即RACSignal类。Signals发出三种类型的事件流:next、completed、和error。
通过此模式,ReactiveCocoa可以用来替代delegate、target-action、key-value observing等模式。
通过signal API创建的代码更加统一且易读.但ReactiveCocoa真正强大之处在于通过这些信号源能进行更多高级操作.这些操作能在相当简洁高雅的操作下执行复杂的筛选、转换、信号协调等。在MVVM中,ReactiveCocoa扮演着重要角色.它提供ViewModel和View之间的绑定操作。
添加
Signal.observeResult
/SignalProducer.startWithResult
for observing values with explicit error handling (#3011, thanks @NachoSoto!)改进
已弃用
Signal.observeNext
/SignalProducer.startWithNext
have been deprecated on error-producing signals/producers in favor of the new result variants (#3011, thanks @NachoSoto!)SignalProducer.buffer()
has been deprecated in anticipation of its removal in RAC 5 (#3015, thanks @mdiep!)Bug修复
SignalProducer(values: Value...)
was ambiguous with SignalProducer(values: [Value])
whenValue
was a signal/producer (#3043, thanks @ikesyo!)MutableProperty
binding leaked when disposing (#3018, thanks @azeff!)