Skip to content

Instantly share code, notes, and snippets.

@pnalvarez
Created March 29, 2020 18:54
Show Gist options
  • Save pnalvarez/5c230cc124b59e476c004ea4dfb310b5 to your computer and use it in GitHub Desktop.
Save pnalvarez/5c230cc124b59e476c004ea4dfb310b5 to your computer and use it in GitHub Desktop.
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