How can I convert a RACDisposable to a Disposable in ReactiveCocoa 5?

191 Views Asked by At

In ReactiveCocoa 5, how can I convert a RACDisposable to a Disposable? If I try to add a RACDisposable to a CompositeDisposable, I get "Binary operator '+=' cannot be applied to operands of type 'CompositeDisposable' and 'RACDisposable'".

1

There are 1 best solutions below

0
Cosyn On

Use a closure to wrap the Objective-C things.

let disposable = CompositeDisposable()

let racDisposable = RACDisposable()

disposable += {
    racDisposable.dispose()
}