扫码工具类,用于检测权限并启动扫码界面,提供Default View扫码方式。
Declaration
@interface HmsDefaultScanViewController : UIViewController
需要初始化DefaultScanView的代理方法:
HmsDefaultScanViewController *hmsDefaultScanViewController; hmsDefaultScanViewController.defaultScanDelegate = self; HmsDefaultScanViewController *hmsDefaultScanViewController = [[HmsDefaultScanViewController alloc] init];
扫码返回结果数据的代理方法。
Declaration
-(void)defaultScanDelegateForDicResult:(NSDictionary *)resultDic
Returns
Type | Description |
|---|---|
NSDictionary | 扫码方式中扫码结果的回调NSDictionary数据,包含以下内容:
|
图片识别码返回结果数据的代理方法。
Declaration
-(void)defaultScanImagePickerDelegateForImage:(UIImage *)image
设置扫码制式选项。
Declaration
-(instancetype)initDefaultScanWithFormatType:(HmsScanOptions *)scanOptions
设置options参数并初始化ScanViewController:
HmsScanOptions *options = [[HmsScanOptions alloc] initWithScanFormatType:ALL Photo:FALSE]; HmsDefaultScanViewController *hmsDefaultScanViewController = [[HmsDefaultScanViewController alloc] initDefaultScanWithFormatType:options];
Name | Description |
|---|---|
Photo | 代表相机扫码或图片扫码,此处传入FALSE为相机扫码。 |
ScanFormatType | ALL是枚举类型参数,可以用位运算符连接多种码制,如:QR_CODE | AZTEC。 |