Swiftpack.co - stuartbreckenridge/SGDataGovModels as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by stuartbreckenridge.
stuartbreckenridge/SGDataGovModels 0.0.8
This package contains the necessary structs and Publishers for each of the NEA API endpoints supported by the data.gov.sg portal.
⭐️ 0
🕓 4 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/stuartbreckenridge/SGDataGovModels.git", from: "0.0.8")

SGDataGovModels

This package contains the necessary structs and Publishers for each of the NEA API endpoints supported by the data.gov.sg portal.

Usage

Include this Package as a dependency: File > Swift Packages > Add Package Dependency.

Data provided by the National Environmental Agency is available via the NEAPublishers class.

Example


var sink: AnyCancellable!

sink = NEAPublishers.pm25.receive(on: RunLoop.main).sink(receiveCompletion: { (result) in
    switch result {
    case .failure(let err):
        // handle error
    case .finished:
        // finished
    }
}, receiveValue: { (downloadedPM25Data) in
    // do something with the data
})

GitHub

link
Stars: 0
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics