Fix QR code bug introduced by Swift 4 #134
This commit is contained in:
parent
79744fc713
commit
25ab22acc7
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ class QRScannerController: UIViewController, AVCaptureMetadataOutputObjectsDeleg
|
||||||
|
|
||||||
// Initialize the captureSession object.
|
// Initialize the captureSession object.
|
||||||
captureSession = AVCaptureSession()
|
captureSession = AVCaptureSession()
|
||||||
|
|
||||||
// Set the input device on the capture session.
|
// Set the input device on the capture session.
|
||||||
captureSession?.addInput(input)
|
captureSession?.addInput(input)
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ class QRScannerController: UIViewController, AVCaptureMetadataOutputObjectsDeleg
|
||||||
|
|
||||||
// MARK: - AVCaptureMetadataOutputObjectsDelegate Methods
|
// MARK: - AVCaptureMetadataOutputObjectsDelegate Methods
|
||||||
|
|
||||||
func metadataOutput(captureOutput: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
|
func metadataOutput(_ captureOutput: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
|
||||||
|
|
||||||
if let metadataObj = metadataObjects.first as? AVMetadataMachineReadableCodeObject,
|
if let metadataObj = metadataObjects.first as? AVMetadataMachineReadableCodeObject,
|
||||||
supportedCodeTypes.contains(metadataObj.type),
|
supportedCodeTypes.contains(metadataObj.type),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue