Networking in RxSwift
We can't do much in an app these days without interacting with a remote server. RxSwift
offers useful extensions for working with the URLSession
API, and there are some excellent community networking libraries available for RxSwift
, including RxAlamOfFire
and Moya. Both utilize AlamOfire
under the hood actually, and they make writing networking code as enjoyable as it should be. We will go through a pretty standard example for this chapter so that it is easy for you to relate to.
We will create a type ahead search app of GitHub repositories for GitHub user ID.
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...