Created
May 15, 2016 03:32
-
-
Save koogawa/169a8399a4da5e2675759162ca3d922d to your computer and use it in GitHub Desktop.
ベニューを取ってきてTableViewに表示するだけなら30行ぐらいで実装できそう #4sqdevjp #CodePiece
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 | |
import RxCocoa | |
class ViewController: UIViewController { | |
@IBOutlet weak var tableView: UITableView! | |
var viewModel = ViewModel() | |
var dataSource = DataSource() | |
var delegate = Delegate() | |
let disposeBag = DisposeBag() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.tableView.delegate = self.delegate | |
self.viewModel.firstRequest() | |
self.viewModel.venues | |
.asDriver() | |
.drive ( | |
self.tableView.rx_itemsWithDataSource(self.dataSource) | |
) | |
.addDisposableTo(self.disposeBag) | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment