Skip to content

Instantly share code, notes, and snippets.

@vhart
Last active August 28, 2017 19:09
Show Gist options
  • Select an option

  • Save vhart/9442d53739506670af52c842a268ca1b to your computer and use it in GitHub Desktop.

Select an option

Save vhart/9442d53739506670af52c842a268ca1b to your computer and use it in GitHub Desktop.
class SomeDeserializer<T, D: JsonDeserializer>: JsonDeserializer {
private let deserializer: D
init<D: JsonDeserializer>(deserializer: D) where D.Response == T {
self.deserializer = deserializer
}
func parse(json: [String : Any]) -> T {
return deserializer.parse(json: json)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment