Swiftpack.co - NaughtyOttsel/PokeKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by NaughtyOttsel.
NaughtyOttsel/PokeKit 0.0.1-b1
A Swift 5 Wrapper for the PokeApi (https://pokeapi.co)
⭐️ 1
🕓 4 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/NaughtyOttsel/PokeKit.git", from: "0.0.1-b1")

PokeKit

A Swift 5 Wrapper for the PokeApi

Installation

Currently the package is only available for Swift Package Manager add the following package to your Package.swift file.

.package(url: "https://github.com/NaughtyOttsel/PokeKit.git", .upToNextMajor(from: "0.0.1")),

Usage

Currently the Package Supports Decoding JSON strings into Classes based on the PokeAPI.

let decoder = JSONDecoder()
let abilityJsonString = // Use your favorite Networking Framework to retrieve data from the PokeAPI
guard let abilityData = abilityJsonString.data(using: .utf8) else {
return
}
let ability = try? decoder.decode(Ability.self, from: abilityData)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

GitHub

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

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