O'Reilly logo

Reactive Programming with Swift 4 by Navdeep Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required