Created
November 8, 2018 04:05
-
-
Save vialyx/35fd1100e543ed4323fc2095fad52e35 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
import UIKit | |
final class ViewController: UIViewController { | |
let apiClient = APIClient() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let resource = Resource(url: URL(string: "https://desolate-beyond-86929.herokuapp.com/arrival")!) | |
apiClient.load(resource) { (result) in | |
switch result { | |
case .success(let data): | |
print("\(self) retrive data: \(String(data: data, encoding: .utf8)) from resource: \(resource)") | |
case .failure(let error): | |
print("\(self) retrive error: \(error) from resource: \(resource)") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment