Creating our ReviewFormController 

  1. Right-click the Review Form folder again and select New File.
  2. Inside of the Choose a template for your new file screen, select iOS at the top, and then Cocoa Touch Class. Then, hit Next.
  3. In the options screen that appears, add the following:

New file:

    • Class: ReviewFormViewController
    • Subclass: UITableViewController
    • Also create XIB: Unchecked
    • Language: Swift
  1. Click Next, and then Create.

Delete everything after the viewDidLoad() method, as we do not need all of the other code. Next, let's set up our ReviewFormViewController by adding the following after the class declaration:

@IBOutlet weak var ratingView: RatingsView!@IBOutlet weak var tfTitle: UITextField!@IBOutlet weak var tfName: UITextField! ...

Get iOS 12 Programming for Beginners - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.