Skip to content
A (probably very naïve) attempt at implementing the `dataTaskPublisher(for: URLRequest)` extension on `URLSession` mentioned in WWDC 2019, Session 712.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Jun 12, 2019
Package.swift Initial check in. Jun 12, 2019


A (probably very naïve) attempt at implementing the dataTaskPublisher(for: URLRequest) extension on URLSession mentioned in WWDC 2019, Session 712. You can see a demo of it at around 20:32.

There's not much to using it:

import Foundation
import IDZSwiftDataTaskPublisher

let request = URLRequest(url: URL(string: "")!)
_ = URLSession.shared.dataTaskPublisher(for: request)
    .sink { print(String(data: $, encoding: .utf8)!) }


This example downloads and prints the HTML for

Using the Package

The package supports the Swift Package Manager. Just add

.package(url: "", from: "0.1.0"),

to your Package.swift

Building the Demo Program

There's a simple demo include in the repository. Change to Demos/macOS/SimpleDemo directory then use swift build to build it and swift run to run it. You should be treated to glorious HTML text on your terminal.

You can’t perform that action at this time.