从Swift3+ 到Swift4二维码扫描遇到一个坑,Mark一下
output.metadataObjectTypes = [AVMetadataObject.ObjectType.qr]
代理方法
Swift3.0+
func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [Any]!, from connection: AVCaptureConnection!)
Swift4.0
func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection)