Displaying a list of restaurants on the Restaurant List screen

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:

  1. 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.

  1. 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() ...

Get iOS 13 Programming for Beginners - Fourth Edition 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.