Adding a Collection View Controller

As we discussed earlier in the book, Collection View Controllers allow us to display elements within a grid. Let's set up our Collection View:

  1. Select the Main.storyboard file, making sure that you are zoomed out and can see all of your scenes. In the Utilities Panel (command + Shift + L), ensure that you have the object library tab selected.
  2. In the filter field, type collec:
  1. Click on and drag Collection View, and drop it onto the Explore View Controller:
  1. You will see small boxes around the entire Collection View component. Select the Pin icon, and enter the following values:
All values under Add New Constraints are set to 0.
  1. Click on Add 4 Constraints.

We now have our Collection View component set up for our Explore tab.