Project setup

We will start out in a single view app with a tableView. Open up the starter project for this chapter, and you will see that we have created a searchController and configured it using configureSearchController() to include the searchBar of the searchController as the tableHeaderView of tableView, as follows:

func configureSearchController() {        searchController.obscuresBackgroundDuringPresentation = false        searchBar.showsCancelButton = true        searchBar.text = "scotteg"        searchBar.placeholder = "Enter GitHub ID, e.g., \"scotteg\""        tableView.tableHeaderView = searchController.searchBar        definesPresentationContext = true    }

Also, we have already bound the data sequence of a viewModel to the tableView, as shown:

viewModel.data            .drive(tableView.rx.items(cellIdentifier: ...

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.