您好我有AVCaptureVideoPreviewLayer
的问题let previewLayer: AVCaptureVideoPreviewLayer = AVCaptureVideoPreviewLayer.layerWithSession(captureSession) as AVCaptureVideoPreviewLayer
previewLayer.frame = UIScreen.mainScreen().bounds
previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
visageCameraView.layer.addSublayer(previewLayer)
'layerWithSession'不可用:使用对象构造'AVCaptureVideoPreviewLayer(session:)'
答案 0 :(得分:5)
正如错误消息所示,您必须
let previewLayer = AVCaptureVideoPreviewLayer(session: captureSession)