title: AVCaptureDevice.Position = AVCaptureDevice.Position.Type
body: <p>I am using the <code>AVCaptureDevice.Position</code> command for a function that takes <code>AVCaptureDevice.Position</code> as one of its parameters. For some reason I am getting the error</p>
  <blockquote>
  <p>Cannot convert value of type 'AVCaptureDevice.Position.Type' to expected argument type 'AVCaptureDevice.Position'</p>
  </blockquote>
  <p>I am not sure why I am getting this error, but here is me calling the function and I will also include the code of the function:</p>
  <pre><code>let visionImage = VisionImage(buffer: sampleBuffer)
  visionImage.orientation = imageOrientation(deviceOrientation: UIDevice.current.orientation, cameraPosition: AVCaptureDevice.Position)
  </code></pre>
  <p>Here is the code for my function:</p>
  <pre><code>func imageOrientation(
        deviceOrientation: UIDeviceOrientation,
        cameraPosition: AVCaptureDevice.Position
      ) -&gt; UIImage.Orientation {
        switch deviceOrientation {
        case .portrait:
          return cameraPosition == .front ? .leftMirrored : .right
        case .landscapeLeft:
          return cameraPosition == .front ? .downMirrored : .up
        case .portraitUpsideDown:
          return cameraPosition == .front ? .rightMirrored : .left
        case .landscapeRight:
          return cameraPosition == .front ? .upMirrored : .down
        case .faceDown, .faceUp, .unknown:
          return .up
        }
  }
  </code></pre>
  <p>Any help would be greatly appreciated!</p>