Hooking up our outlets

Let's now link our file, RestaurantViewController, to our new UIViewController in storyboard:

  1. Select the UIViewController with the Collection View that we just created.
  2. Now, in the Utility panel, select the Identity inspector. Under Custom Class, in the Class drop-down menu, select RestaurantViewController and hit Enter.
  3. After you hit Enter, select the Connections Inspector in the Utilities panel.
  4. Under Outlets, click on the collectionView circle and drag from the circle to Collection View that we just added inside of your UIViewController.

Now that we have our Collection View hooked up, we need to hook up the data source and delegate. This allows us to pass data to our Collection View as well as know when our Collection View has some kind of interaction.

  1. In your scene, select your Collection View. Then, in your Utilities panel, select the Connections Inspector.
  2. Click on and drag the dataSource property to the Restaurant View Controller in your Outline view.
  3. Click on and drag the delegate property to the Restaurant View Controller in your Outline view.

Finally, let's set up our cell to have a color so we can make sure we have everything set up correctly.