Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVCaptureMetadataOutputObjectsDelegate not called in swift 4 for QR scanner

I was working on QR code scanner app on iOS where i was getting output AVCaptureOutput on the delegate method captureOutput:didOutputMetadataObjects:fromConnection:.

It was working perfectly on swift 3. After I've updated to xcode 9 and swift 4, it stopped working.

like image 898
Arnab Avatar asked Oct 09 '17 05:10

Arnab


1 Answers

Okay I've found an update here.

Found that AVCaptureMetadataOutputObjectsDelegate method is changed

from

captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [Any]!, from connection: AVCaptureConnection!)

to

metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection)

After changing this delegate method, its working good now.

like image 166
Arnab Avatar answered Sep 27 '22 03:09

Arnab