Skip to content

Instantly share code, notes, and snippets.

@lucasecf
Last active March 4, 2018 17:53
Show Gist options
  • Save lucasecf/12636027d7cdd923d1c2bcdddb69755c to your computer and use it in GitHub Desktop.
Save lucasecf/12636027d7cdd923d1c2bcdddb69755c to your computer and use it in GitHub Desktop.
struct GetMoviesTask {
let dispatcher: Dispatcher
func load(success: ([Movie]) -> Void, failure: (Error) -> Void) {
let request = URLRequest(url: URL(string: “www.mydomain.com/movies")!)
dispatcher.execute(request: request, success: { data in
// (…)
}, failure: { error in
// (…)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment