Created
November 14, 2018 21:43
-
-
Save pzmudzinski/b3c9adeb486973e1fe1885922fb20bb6 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
import UIKit | |
import RxDataSources | |
import RxSwift | |
class ViewController: UIViewController { | |
@IBOutlet weak var tableView: UITableView! | |
let dataSource = createDataSource() | |
let disposeBag = DisposeBag() | |
var viewModel: BooksViewModel! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.viewModel = BooksViewModel() | |
viewModel.items.map { books in | |
[SectionOfBooks( | |
header: "My books", | |
items: books | |
)] | |
} | |
.bind(to: tableView.rx.items(dataSource: dataSource)) | |
.disposed(by: disposeBag) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment