Skip to content

Instantly share code, notes, and snippets.

@pffan91
Last active November 29, 2017 09:46
Show Gist options
  • Save pffan91/a49578ec8d66a96dba36f13b7b83e413 to your computer and use it in GitHub Desktop.
Save pffan91/a49578ec8d66a96dba36f13b7b83e413 to your computer and use it in GitHub Desktop.
NetworkLayerWithMoya_sendRequest
// Created by Vladyslav Semenchenko on 15/05/2017.
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved.
let provider = MoyaProvider<MyServerAPI>()
provider.request(.cameras) { (result) in
switch result {
case .success(let response):
// do something with resoinse
case .failure(let error):
// show error
}
}
@AamirAnwar
Copy link

Hey! Noticed a small typo in the comment on line 8
It should be -
// do something with the response

P.S - Great blog on medium (y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment