Given
let numberOfSneezes = Property<Int>(0)
how do i turn numberOfSneezes.producer
into this type of producer
let sneezeNumberProducer: SignalProducer<Int, PossibleError>
?
I know numberOfSneezes.producer
is not going to send any errors, but i need to assign it to sneezeNumberProducer
anyway.
You can use promoteError()
. Here is the documentation for it.
sneezeNumberProducer = numberOfSneezes.producer.promoteError(PossibleError.self)