Let's now link our file, RestaurantViewController
, to our new UIViewController
in storyboard:
- Select the
UIViewController
with theCollection View
that we just created. - Now, in the Utility panel, select the Identity inspector. Under
Custom Class
, in theClass
drop-down menu, selectRestaurantViewController
and hit Enter. - After you hit Enter, select the
Connections Inspector
in the Utilities panel. - Under
Outlets
, click on thecollectionView
circle and drag from the circle toCollection View
that we just added inside of yourUIViewController
.
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.
- In your scene, select your
Collection View
. Then, in your Utilities panel, select theConnections Inspector
. - Click on and drag the
dataSource
property to the Restaurant View Controller in your Outline view. - Click on and drag...