Created
March 29, 2020 19:55
-
-
Save pnalvarez/6b64e3f9bd88c7d6062ab569b4f6c6cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol PokemonListManagerInput { | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) | |
} | |
class PokemonListManager: PokemonListManagerInput { | |
var objects: [PokemonAPIModel] = [] | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) { | |
PokemonAPI.shared.getPokemons { | |
objects in | |
self.objects = objects | |
completion(self.objects) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment