You now have everything you need to display a list of restaurants based on the selected location and cuisine on the Restaurant List screen. So, now it's time to put it all together. Perform the following steps:
- Click RestaurantListViewController.swift in the Project navigator. Above the selectedRestaurant property, add the following:
var manager = RestaurantDataManager()
This creates an instance of RestaurantDataManager and assigns it to manager.
- Add the following method inside the private extension:
func createData() { guard let location = selectedCity?.city, let filter = selectedType else { return } manager.fetch(by: location, with: filter) { _ in if manager.numberOfItems() ...