文章来源:淘论文网   发布者: 毕业设计   浏览量: 26



还可以点击去查询以下关键词:
[LBXSca]    [定制]    [扫码]    [封装]    [LBXSca定制n的扫码封装]   

项目介绍:

基于LBXScan进行的扫码封装,更加简化了实用方式,两行代码即可实现扫码功能  1.首先在项目中pod如下库
  

pod 'ZXingObjC', '~> 3.0'
  
pod 'LBXAlertAction'
  
pod 'ZYCornerRadius', git:'https://github.com/liuzhiyi1992/ZYCornerRadius.git',tag:'0.9.1'
  

2.在项目中建立全局pch文件加入如下代码,开题报告,不然会报错
  

#import <Foundation/Foundation.h>
  
#import <UIKit/UIKit.h>
  

3.在项目中拖入ScanHelper以及LBXScan两个文件夹
  4.在需要实现扫码的地方导入头文件
  

#import 'ScanHelper.h'
  

5.在相应位置添加代理
  

@interface ViewController ()<ScanStyleDelegate>
  

6.在扫码方法中添加如下两行代码
  

    //如果想自定义样式在ScanHelper中修改即可,论文,将“qqStyle”替换为相应样式名称  
    [ScanHelper shareInstance].delegate = self;  
    [[ScanHelper shareInstance] goScanWithStyle:@"qqStyle"];  

7.实现相应代理方法即可实现扫码
  

    #pragma mark ScanHelper 代理方法  
    - (void)pushScanController:(UIViewController *)controller{  
         [self.navigationController pushViewController:controller animated:YES];  
    }  

8.扫码结果在ScanQRViewController中showNextVCWithScanResult方法处理  

    - (void)showNextVCWithScanResult:(LBXScanResult*)strResult  
    {  
         //这里处理扫描结果  
    }  

9.特别注意在iOS10以上要修改隐私权限,找到info.plist文件右键source code方式打开,添加如下代码即可  

        <key>NSCameraUsageDescription</key>  
            <string>是否允许使用相机</string>  
            <key>NSPhotoLibraryUsageDescription</key>  
            <string>是否允许打开相册</string>  

github地址:github](https://github.com/MichealMIX/ScanHelper))


这里还有:


还可以点击去查询:
[LBXSca]    [定制]    [扫码]    [封装]    [LBXSca定制n的扫码封装]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/7653.docx
  • 上一篇:iOS抽屉效果实现 - MMDrawerController
  • 下一篇:股票走势图,包括 K 线图,分时图,并提供横屏展示,手...