Creating our PhotoFilterViewController

Now, we need to create our PhotoFilterViewController:

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

New file:

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

When the file opens, delete everything after the viewDidLoad() method.

  1. Then, add the following:
class PhotoFilterViewController: UIViewController {    var image: UIImage?    var thumbnail: UIImage?    let manager = FilterManager()    var selectedRestaurantID:Int? var data:[FilterItem] ...

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.