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 Main.storyboard
, and 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
Main.storyboard
in the Project navigator, and click the Library button: - The library will appear. Type...