Here's an example for capturing an image using AVCaptureSession in Swift:
main.swift1988 chars61 linesTo capture an image, call the capturePhoto() function. The captured image will be in the capturedImage variable in the photoOutput(_:didFinishProcessingPhoto:error:) delegate method.
gistlibby LogSnag