Driver

Driver intended use is to reactively bind an Observable sequence to a UIElement. It will also replay its latest element to its new subscriber, if there is one. We can convert an Observable sequence to a driver by calling asDriver() on it. As Driver cannot fail, if the Observable can fail, we will need to use one of the asDriver() APIs such as asDriver(onErrorJustReturn:) to provide a return value in the event that the underlying Observable sequence emits an error. For example, in the case of an Observable sequence of an array, we can just return an empty array.

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.