Adopting the delegate and data source protocols

You will modify RestaurantListViewController in order to adopt the collection view data source and delegate protocols and add the required protocol methods. You'll also add an outlet for the collection view and make RestaurantListViewController the view controller for the view. Go through the following steps:

  1. Modify the RestaurantListViewController class declaration, as shown in the following code, to adopt the UICollectionViewDataSource and UICollectionViewDelegate protocols:
class RestaurantListViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {   
  1. When the error icon appears, click it.
  2. You can see this error because the methods that are required to conform ...

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.