title: Type 'String!' has no member 'photo'
body: <p>I am following a tutorial on Youtube about CoreML: Real Time Camera object detection with machine learning - Swift 4 by Mr. Brian</p>
  
  <pre><code>captureSession.sessionPreset = .photo
  </code></pre>
  
  <p>In this line, the error says:</p>
  
  <blockquote>
    <p>Type "String" has no member 'photo'.</p>
  </blockquote>
  
  <pre><code>dataOutput.setSampleBufferDelegate(self, queue: DispatchQueue(label: "videoQueue"))
  </code></pre>
  
  <p>And another error is the 'self' part. The error is:</p>
  
  <blockquote>
    <p>Cannot convert value of type 'ViewController' to expected argument type 'AVCaptureVideoDataOutputSampleBufferDelegate!'</p>
  </blockquote>
  
  <p>Below is the whole code:</p>
  
  <pre><code>import UIKit
  import AVFoundation
  import AVKit
  import Vision
  
  class ViewController: UIViewController,         AVCaptureAudioDataOutputSampleBufferDelegate {
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // here is where we start up the camera
          let captureSession = AVCaptureSession()
          captureSession.sessionPreset = .photo
  
          guard let captureDevice =
              AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo) else { return }
  
          guard let input = try? AVCaptureDeviceInput(device:
              captureDevice) else { return }
          captureSession.addInput(input)
  
          captureSession.startRunning()
  
          let previewLayer = AVCaptureVideoPreviewLayer(session:
              captureSession)
          view.layer.addSublayer(previewLayer!)
          previewLayer!.frame = view.frame
  
          let dataOutput = AVCaptureVideoDataOutput()
          dataOutput.setSampleBufferDelegate(self, queue: DispatchQueue(label: "videoQueue"))
          captureSession.addOutput(dataOutput)
  </code></pre>