ConcurrentDispatchQueueScheduler

In this example, we are starting out on the main thread. First, we will create an imageData PublishSubject of type data. We will be adding the Swift and Rx image data values onto this sequence later on. Next, we will create a concurrentScheduler by making use of the ConcurrentDispatchQueueScheduler convenience initializer, which takes a Quality of Service (QoS) enum and sets that to the background, as follows:

let imageData = PublishSubject<Data>()let concurrentScheduler = ConcurrentDispatchQueueScheduler(qos: .background)

Now we will use ObserveOn to indicate that we want events received from the sequence on the concurrentScheduler we created, and we will use map to transform that data into a UIImage instance, ...

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.