Latest 0.3.0
Homepage https://github.com/kiliankoe/ParkKit
License MIT
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0
Dependencies Marshal
Frameworks Foundation
Authors

🚘 ParkKit

Travis
Version
License
Platform
Docs
Codecov

This is a wrapper for the API provided by ParkAPI for anything written in Swift. It’s primary purpose is to be used by ParkenDD.

Example

let park = ParkKit() // uses the default server at parkendd.de
// let park = ParkKit(withURL: URL(string: "https://your_server.com")!) // uses your server
park.fetchCities { result in
    guard let response = result.success else { return }
    print(response.cities)
}

// ▿ 13 elements
//   ▿ ParkKit.City
//     - name: "Aarhus"
//     ▿ coordinate: __C.CLLocationCoordinate2D
//       - latitude: 56.153005
//       - longitude: 10.203201
//       ...
park.fetchLots(forCity: "Dresden") { result in
    guard let response = result.success else { return }
    print(response.lots)
}

// ▿ 48 elements
//   ▿ ParkKit.Lot
//     ▿ address: Optional("Wilsdruffer Straße")
//       ...
let startingDate = Date()
let endingDate = startingDate.addingTimeInterval(60 * 60 * 24) // 24 hours later

park.fetchForecast(forLot: "dresdencentrumgalerie", inCity: "Dresden", startingAt: startingDate, endingAt: endingDate) { result in
    guard let response = result.success else { return }
    print(response.forecast)
}

// ▿ 97 elements
//   ▿ (2 elements)
//     - .0: 2017-01-11 00:00:00 +0000
//     - .1: 13
//   ▿ (2 elements)
//     - .0: 2017-01-11 00:15:00 +0000
//     - .1: 12
//   ...

Requirements

Should you be hosting your own version of the ParkAPI server and using this on iOS, you might have to set up an ATS exception if you don’t serve the data via HTTPS.

Using your own server is definitely recommended should you be planning on executing a large amount of requests (e.g. through a multitude of client applications).

Installation

ParkKit is available through Cocoapods, Carthage/Punic and Swift Package Manager, take your pick.

Copypasta for your Podfile:

pod "ParkKit"

Cartfile:

github "kiliankoe/ParkKit"

Package.swift:

.Package(url: "https://github.com/kiliankoe/ParkKit", majorVersion: 0)

Contributors

Kilian Koeltzsch, @kiliankoe

License

ParkKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ParkKit",
    "version": "0.3.0",
    "summary": "ParkAPI wrapper for Swift apps",
    "description": "This is a wrapper for the API provided by [ParkAPI](https://github.com/offenesdresden/ParkAPI) for anything written in Swift.nIt's primary purpose is to be used by [ParkenDD](https://github.com/kiliankoe/ParkenDD).",
    "homepage": "https://github.com/kiliankoe/ParkKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kilian Koeltzsch": "[email protected]"
    },
    "social_media_url": "https://twitter.com/kiliankoe",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/kiliankoe/ParkKit.git",
        "tag": "0.3.0"
    },
    "source_files": "Sources/**/*",
    "frameworks": "Foundation",
    "dependencies": {
        "Marshal": [
            "1.2.4"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This