     }
     
     // 2. setup outputs
-    let output = AVCapturePhotoOutput()
     if captureSession.canAddOutput(output) {
         captureSession.addOutput(output)
     }

    $0.addTarget(self, action: #selector(handleCapturePhoto), for: .touchUpInside)
  }
  
  override func viewDidLoad() {
    super.viewDidLoad()
    

import UIKit
import AVFoundation

class CameraController: UIViewController, AVCapturePhotoCaptureDelegate {
  
  // MARK: - Properties
  
  let output = AVCapturePhotoOutput()
  
  lazy var dismissButton = UIButton(type: .system) <== {
    $0.setImage(#imageLiteral(resourceName: "right_arrow_shadow"), for: .normal)
