Created
November 26, 2018 12:48
-
-
Save serhatsezer/19acf971171a1704bced23ddd92f8813 to your computer and use it in GitHub Desktop.
This file contains 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
// ViewController.swift | |
func call(user: String) { | |
gitHubProvider.request(.userProfile(user)) { (result) in | |
switch result { | |
case .success(let data): | |
if let jsonData = try? data.mapJSON() { | |
print(jsonData) | |
} else { | |
print("error parsing to JSON") | |
} | |
case .failure(let error): | |
print(error.localizedDescription) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment