目录

HmsDefaultScanViewController

扫码工具类,用于检测权限并启动扫码界面,提供Default View扫码方式。

Declaration

@interface HmsDefaultScanViewController : UIViewController

需要初始化DefaultScanView的代理方法:

HmsDefaultScanViewController *hmsDefaultScanViewController;
hmsDefaultScanViewController.defaultScanDelegate = self;
HmsDefaultScanViewController *hmsDefaultScanViewController = [[HmsDefaultScanViewController alloc] init];

defaultScanDelegateForDicResult

扫码返回结果数据的代理方法。

Declaration

-(void)defaultScanDelegateForDicResult:(NSDictionary *)resultDic

Returns

Type

Description

NSDictionary

扫码方式中扫码结果的回调NSDictionary数据,包含以下内容:

  • zoomValue:相机镜头放大系数。
  • text:码返回值。
  • exposureAdjustmentValue:曝光系数。
  • formatValue:码制式。
  • ResultPoint:码图角点坐标位置。
  • sceneType:场景类型。
  • parserDic:对应场景返回的值。其中包含有:
    • Contact(联系人信息)
    • Email(邮箱)
    • WebSite(URL链接)
    • ISBN
    • Location(地理位置信息)
    • SMS(SMS短信信息)
    • Tel(电话)
    • EVENT(日历事件信息)
    • Wi-Fi(Wi-Fi信息)

defaultScanImagePickerDelegateForImage

图片识别码返回结果数据的代理方法。

Declaration

-(void)defaultScanImagePickerDelegateForImage:(UIImage *)image

initDefaultScanWithFormatType

设置扫码制式选项。

Declaration

-(instancetype)initDefaultScanWithFormatType:(HmsScanOptions *)scanOptions

设置options参数并初始化ScanViewController:

HmsScanOptions *options = [[HmsScanOptions alloc] initWithScanFormatType:ALL Photo:FALSE];
HmsDefaultScanViewController *hmsDefaultScanViewController = [[HmsDefaultScanViewController alloc] initDefaultScanWithFormatType:options];
Parameters

Name

Description

Photo

代表相机扫码或图片扫码,此处传入FALSE为相机扫码。

ScanFormatType

ALL是枚举类型参数,可以用位运算符连接多种码制,如:QR_CODE | AZTEC。