A minimal setup for camera output preview (Swift 2, Swift 3)
import UIKit
import AVFoundation
class ViewController: UIViewController {
var session: AVCaptureSession?
var cameraPreviewLayer: AVCaptureVideoPreviewLayer?
override func viewDidLoad() {
super.viewDidLoad()
...