CIDetctor always remains nil, Cant read QRCode

ε祈祈猫儿з 提交于 2019-12-08 09:46:12

问题


I cannot initialize CIDetector for reading QRCOde , It always remains nil. Here is my code :

let options = [CIDetectorAccuracy: CIDetectorAccuracyHigh]
            self.detector =  CIDetector(ofType: CIDetectorTypeQRCode, context: nil, options: options)

If I replace CIDetectorTypeQRCode with CIDetectorTypeRectangle it get initialized but I need to read QRCode

I am trying from last two days, Please help


回答1:


Finally got that working:

Follow the steps:

  1. Select XcodeProject
  2. Select Target
  3. Select BuildSettings
  4. Make Sure ValidArchitecture have arm64 or replace it with (arm64 armv7 armv7s)


来源:https://stackoverflow.com/questions/35885137/cidetctor-always-remains-nil-cant-read-qrcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!