Tracking down issues – Debugging Rx code

In addition to using traditional debugging techniques, RxSwift also provides a couple of useful utilities to debug Observable sequences. To demonstrate this, we have created a starter project and initialized a helper class to declare the following two methods, as follows:

public func exampleOf(description: String, actionToPerform: () -> Void) {    print(" ===> Example of:", description, "===>")    actionToPerform()}public func delayInExecution(_ delayInterval: TimeInterval, actionToPerform: @escaping () -> Void) {    DispatchQueue.main.asyncAfter(deadline: .now() + delayInterval) {        actionToPerform()    }}

The delayInExecution() wraps a DispatchQueue to execute an action asynchronously after a delay. As we are ...

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.