This Swift package provides a comprehensive and efficient solution for accessing and utilizing data related to Pokemon from the PokeAPI. It simplifies the process of fetching, parsing, and managing Pokemon information within your iOS applications.
⚠️
As the package is still in development phase, not all PokeAPI resources are available yet
Please check-out the resources by category section.
.package(url: "https://github.com/ThomasG51/PokeAPIService", from: "<version>")https://github.com/ThomasG51/PokeAPIService
A core strength of this package is its ability to seamlessly fetch data directly from each model. Each Pokemon, Pokedex, Generation or other can initiate a request to PokeAPI and populate its properties.
⚠️ Please note that due to restrictions by the underlying API, some models do not have acces to all fetching functions. Refer to the specific model documentation for more details.
let pokemonID = 1
Pokemon.selectOne(by: pokemonID)
let generationID = 1
Generation.selectOne(by: generationID)
let pokedexID = 1
Pokedex.selectOne(by: pokedexID)
let versionID = 1
Version.selectOne(by: versionID)let pokemonName = "bulbasaur"
Pokemon.selectOne(by: pokemonName)
let generationName = "generation-i"
Generation.selectOne(by: generationName)
let pokedexName = "kanto"
Pokedex.selectOne(by: pokedexName)
let versionName = "red"
Version.selectOne(by: versionName)Pokemon.selectAll(from: 151, count: 100)
Generation.selectAll() // Without count argument, the list will be paginate by 20 by default
Pokedex.selectAll(count: 3)
Version.selectAll(from: 0, count: 1)Pokemon.lightResources(from: 0, count: 151)
Generation.lightResources(from: 0, count: 1)
Pokedex.lightResources(from: 1, count: 1)
Version.lightResources(from: 0, count: 4)- Berry
- BerryFirmness
- BerryFlavor
- Generation
- Pokedex
- Version
- VersionGroup
- Ability
- Characteristic
- EggGroup
- Gender
- GrowthRate
- Nature
- PokeathlonStat
- Pokemon
- PokemonColor
- PokemonLocationArea
- PokemonForm
- PokemonHabitat
- PokemonShape
- PokemonSpecies
- PokemonType
- Stat
PokeAPIService is available under the MIT license.