Last active
February 17, 2020 00:04
-
-
Save yzhong52/acbb6903d9c412620b46cfa3b471363c to your computer and use it in GitHub Desktop.
Building a Client App From Scratch (ViewController with Client)
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
import UIKit | |
import RxSwift | |
class ViewController: UIViewController { | |
private let disposeBag = DisposeBag() | |
private let client = NewsClient() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
client.headlines().subscribe(onSuccess: { (response) in | |
print("Receive news: \(response)") | |
}, onError: { (error) in | |
print("Receive error: \(error)") | |
}).disposed(by: disposeBag) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment