I would like to do some heavy lifting in the background thread of my iOS app and NOT freeze the UI while it is being performed. What I try is:
self.someDisposable = heavyLiftingFuncReturningObservable()
.subscribeOn(ConcurrentDispatchQueueScheduler(qos: .background))
.observeOn(MainScheduler.instance)
.subscribe(
onNext: { [weak self] image in
// update UI
},
onError: { ... }
)
Why does the above not work as expected and how to make it work?