Created
January 2, 2018 14:29
-
-
Save joelmarquez90/60ad1d8023e61273c5f52db1a3931850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let moyaProvider = MoyaProvider<Service>() | |
moyaProvider.request(.version(version: "2.2.0")) { result in | |
switch result { | |
case let .success(response): | |
var version: Version | |
do { | |
version = try response.map(Version.self) | |
print(version) | |
} catch { | |
print(error) | |
} | |
case .failure(error): | |
print(error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment