Adding a collection view to the Explore screen
A collection view is an instance of the UICollectionView
class. Like a spreadsheet program, it displays a grid of cells. Each cell in a collection view is a collection view cell, which is an instance of the UICollectionViewCell
class. You'll start by adding a collection view to the view controller scene for the Explore screen in the Main
storyboard file, then you'll add Auto Layout constraints to make it fill the screen.
Important Information
For more information on Auto Layout and how to use it, go to https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/.
Open the LetsEat
project you created in the previous chapter and run the app to make sure everything still works as it should, then follow these steps:
- Click the
Main
storyboard file in the Project navigator, and click the Library button: