Skip to content

Instantly share code, notes, and snippets.

@anupamchugh
Created August 21, 2020 15:05
Show Gist options
  • Save anupamchugh/5fec73a28c85620744e8d90cb49a9ad8 to your computer and use it in GitHub Desktop.
Save anupamchugh/5fec73a28c85620744e8d90cb49a9ad8 to your computer and use it in GitHub Desktop.
let availableDevices = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera], mediaType: AVMediaType.video, position: .back).devices
do {
if let captureDevice = availableDevices.first {
captureSession.addInput(try AVCaptureDeviceInput(device: captureDevice))
}
} catch {
print(error.localizedDescription)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment