Showing restaurants 

We will display a list of restaurants, just like in our app, but we will not be doing the entire interface. Most of this code will be familiar to you, as we have used it before:

  1. Open up the MessagesViewController.swift file in the Navigator panel and add the following code inside of the class declaration:
@IBOutlet var collectionView: UICollectionView!let manager = RestaurantDataManager()var selectedRestaurant:RestaurantItem?
  1. Set up the Collection View defaults. Add the following method inside a private extension:
private extension MessagesViewController {    func setupCollectionView() {        let flow = UICollectionViewFlowLayout()        flow.sectionInset = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7) flow.minimumInteritemSpacing ...

Get iOS 12 Programming for Beginners - Third 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.