If we do not add Auto Layout to our cells, they will not look correct; so, let's do that now:
- Open
RestaurantDetail.storyboard
. - Next, select the Container View, the one used for reviews, and then the Pin icon. Enter the following values:
Top
:0
Right
:0
Bottom
:0
Left
:0
Constrain to margins
: Unchecked
- Click
Add 4 Constraints
. - Now, select the Collection View, the one used for reviews, and then the Pin icon. Enter the following values:
Top
:0
Right
:0
- Bottom:
0
Left
:0
Constrain to margins
: Unchecked
- Click
Add 4 Constraints
.
Build and run your project and add a couple of reviews; you should now see reviews appearing in your restaurant details:
We have two more things I would like to update before the end of this chapter. Now that we are saving reviews, we have an overall rating for restaurants. Let's add this next.