未在QR扫描仪的swift 4中调用AVCaptureMetadataOutputObjectsDelegate [英] AVCaptureMetadataOutputObjectsDelegate not called in swift 4 for QR scanner
本文介绍了未在QR扫描仪的swift 4中调用AVCaptureMetadataOutputObjectsDelegate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在iOS上的QR码扫描仪应用程序上工作,在那里我在委托方法 captureOutput:didOutputMetadataObjects:fromConnection:
上获取输出 AVCaptureOutput
.
I was working on QR code scanner app on iOS where i was getting output AVCaptureOutput
on the delegate method captureOutput:didOutputMetadataObjects:fromConnection:
.
它在swift 3上运行良好.在我更新到xcode 9和swift 4之后,它停止了工作.
It was working perfectly on swift 3. After I've updated to xcode 9 and swift 4, it stopped working.
推荐答案
Okay I've found an update here.
发现 AVCaptureMetadataOutputObjectsDelegate
方法已更改
来自
captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [Any]!, from connection: AVCaptureConnection!)
到
metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection)
更改此委托方法后,现在可以正常工作了.
After changing this delegate method, its working good now.
这篇关于未在QR扫描仪的swift 4中调用AVCaptureMetadataOutputObjectsDelegate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文