Skip to content

Instantly share code, notes, and snippets.

@nickmeehan
Created November 7, 2016 19:46
Show Gist options
  • Save nickmeehan/631e9c1fab4435b1ec45f893145330ad to your computer and use it in GitHub Desktop.
Save nickmeehan/631e9c1fab4435b1ec45f893145330ad to your computer and use it in GitHub Desktop.
AVFoundation - viewDidLoad
override func viewDidLoad() {
super.viewDidLoad()
let deviceTypes: [AVCaptureDeviceType] = [.builtInDuoCamera, .builtInTelephotoCamera, .builtInWideAngleCamera]
let devices = AVCaptureDeviceDiscoverySession(deviceTypes: deviceTypes, mediaType: AVMediaTypeVideo, position: .back).devices
if let device = devices?.first {
self.captureDevice = device
beginSession()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment