onErrorRecover

At times, we might want to perform an additional action before recovering from an error like this; for this, we have onErrorRecover. It schedules a recovery sequence to run on the next loop. In order to show this on playground, we need to write this on a global scope, that is, not enclose it in the example (for) method call, and we will also need to import playground support and set needsIndefiniteExecution to true. This will give schedule recovery time to execute. We will write something like this:

print("... Example for: Driver onErrorRecover.....")import PlaygroundSupportPlaygroundPage.current.needsIndefiniteExecution = true

We will now duplicate the code from within the first example again, and this time, we will use

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.