Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
private let captureSession = AVCaptureSession()
private func setCameraInput() {
guard let device = AVCaptureDevice.DiscoverySession(
deviceTypes: [.builtInWideAngleCamera, .builtInDualCamera, .builtInTrueDepthCamera],mediaType: .video, position: .back).devices.first else {
fatalError("No back camera device found.")
let cameraInput = try! AVCaptureDeviceInput(device: device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment