We are now going to set up our rating control:
- Open up ReviewForm.storyboard.
- In the object library of the Utilities panel, type view in the filter field.
- Delete the image with the five empty stars.
- Then, drag out a View into the cell with the empty stars.
- Select the View and, in the Size inspector, update the following values:
-
- X: 133
- Y: 7
- Width: 108
- Height: 17
- Next, in the Identity inspector, update the Custom Class to RatingsView and hit Enter.
- Next, select the view inside of the view and then select the Pin icon and enter the following values:
-
- Top: 7
- Constrain to margins: Unchecked
- Width: 108 (should be checked)
- Height: 17 (should be checked)
- Click Add 3 Constraints.
- Next, click the Align icon and enter the value of Horizontally in Container as 0 (should be checked).
- Click Add 1 Constraint.
- Select the label that says Tap a Star to Rate.
- Then, select the Pin icon and enter the value of Top as 1.
- Click Add 1 Constraints.
- Next, select the Restaurant View Controller, then in the Identity inspector, update the Custom Class to RatingsView and hit Enter.
Our form is now updated; let's create our controller next.