Skip to content

Instantly share code, notes, and snippets.

@nderkach
Last active December 7, 2017 14:48
Show Gist options
  • Save nderkach/13cc2e3192f8f48859d7496c1bf2f4cd to your computer and use it in GitHub Desktop.
Save nderkach/13cc2e3192f8f48859d7496c1bf2f4cd to your computer and use it in GitHub Desktop.
fileprivate init() {
...
let jsonDecoder = JSONDecoder()
// –––––– Mapping from specific paths to models ––––––
service.configureTransformer("/status") {
try jsonDecoder.decode([String: String].self, from: $0.content)
}
}
// MARK: - Resource Accessors
func status() -> Resource {
return service.resource("/status")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment