-
-
Save anupamchugh/2fb97dd60beb6da0228c4bc1746bbe5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
self.captureSession.addInput(cameraInput) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment