Swiftpack.co - Package - shamanskyh/NextBusKit

NextBusKit

A simple API wrapper in Swift for NextBus transit information.

Examples

Initialize a transit Agency:

let agency = Agency(tag: "sf-muni", title: "San Francisco Municipal Railway", regionTitle: "California-Northern")

Get an Agency's routes:

do {
    let nJudah = try agency.routes().filter({ $0.tag == "N" })
} catch {
    fatalError()
}

Get Predictions for a Stop:

do {
    let powellOutbound = Stop(agency: agency, stopTag: "6995", title: "Powell Station Outbound", location: (37.7843, -122.4078199), stopId: "16995")
    let (predictions, _) = try powellOutbound.predictions()
} catch {
    fatalError()
}

Important Notes

Unless otherwise marked, calls should be assumed to be synchronous. It's a good idea to dispatch to a background queue, query routes/stops, then dispatch back to main when you're ready to update your UI.

Github

link
Stars: 2
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

0.1.3 - Oct 23, 2017

0.1.2 - May 15, 2017

0.1.1 - May 10, 2017

0.1.0 - May 9, 2017