Quite often we encounter a problem of downloading files by links from the backend when writing apps. Let's take a look at how it might be achieved with Combine. The code below contains a dummy asymchronous task and transforms publisher's output values from a series of links to and an actual data items(images). A returned publisher might be used in a view model as a provider for UIImageView's for example.
import UIKit
import Combine
import WebKit
import PlaygroundSupport
enum CustomNetworkingError: Error {
case invalidServerResponse