Created
March 29, 2020 18:51
-
-
Save pnalvarez/4f0377f8efea03fb244509d4670a80da to your computer and use it in GitHub Desktop.
Illustrating Pokemon Mapper
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
static func parse(from details: PokemonDetailsEntity) -> PokemonDetailsViewModel { | |
var typeString = "" | |
for type in details.types { | |
typeString.append(contentsOf: "\(type) ") | |
} | |
return PokemonDetailsViewModel(name: details.name, info: " order: \(details.order)\n weight: \(details.weight)\n height: \(details.height)\n base experience: \(details.baseExperience)", id: details.id, image: URL(string: details.image) , types: typeString, mainMove: details.mainMove) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment