O'Reilly logo

Learn iOS 11 Programming with Swift 4 - Second Edition by Craig Clayton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating our apply filter view controller

Now we need to create our PhotoFilterViewController:

  1. Right-click the Photo Filter folder in the Controller folder in the Review 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.
  3. 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() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required