ios系统扫码,相册二维码识别

1.扫码

​AVCaptureDevice* device;​ 获取设备

AVCaptureDeviceInput* input​  输入

AVCaptureMetadataOutput* output 输出

AVCaptureSession* session;​  链接输入和输出的桥梁

AVCaptureVideoPreviewLayer* preview​ 扫码的界面的layer

- (void)captureOutput:(AVCaptureOutput*)captureOutput didOutputMetadataObjects:(NSArray*)metadataObjects fromConnection:(AVCaptureConnection*)connection​

从这里面获取扫码的结果

2.识别相册里的二维码

CIDetector*detector 获取图片中的信息

CIDetector*detector = [CIDetectordetectorOfType:CIDetectorTypeQRCode

context:[CIContextcontextWithOptions:nil]

options:detectorOptions];

具体的实现在demo​

https://github.com/hkkh/KHQRManger.git​

// 代码可能有问题 需要可以自己修改

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容