In ReactiveCocoa 4, we could convert a RACSignal
into a SignalProducer
using toSignalProducer()
. This method does not exist in ReactiveCocoa 5, so how can we do the same thing?
Use bridgedSignalProducer()
in ReactiveObjCBridge:
someSignal.toSignalProducer()
becomes
bridgedSignalProducer(from: someSignal)
This produces a SignalProducer<Value?, AnyError>
. Unlike RAC 4's startWithNext()
, RAC 5's startWithValues()
is only on SignalProducer
s whose Error
type is NoError
. To get around this, I added a utility function on SignalProducer
that behaves the same way as startWithValues
but works with any Error
type (ignoring any error.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With