Inside the RatingsView.swift file, we first need to create all of the variables we will need. Add the following under the class declaration:
let imgFilledStar = #imageLiteral(resourceName: "filled-star")
let imgHalfStar = #imageLiteral(resourceName: "half-star")
let imgEmptyStar = #imageLiteral(resourceName: "empty-star")
let shouldBecomeFirstResponder = true
var rating:CGFloat = 0.0
var totalStars = 5
If you copy and paste this code, you will have to select each image to see the actual image. If you are having trouble using an image literal, you can use UIImage(named:) instead.
We are doing something new in this file. We are using image literals as our variables. If you type Image Literal in your file and hit return, you will see a small icon:
Double-click this icon and a modal will appear, which will allow...