目录

HmsDefaultScanViewController

Barcode scanning utility class, which is used to check permissions and start the barcode scanning screen. It supports barcode scanning in Default View mode.

Declaration

@interface HmsDefaultScanViewController : UIViewController

Initialize delegate methods of DefaultScanView.

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

defaultScanDelegateForDicResult

Delegate method for returning scanning result data.

Declaration

-(void)defaultScanDelegateForDicResult:(NSDictionary *)resultDic

Returns

Type

Description

NSDictionary

NSDictionary class that contains scanning result data, including:

  • zoomValue: camera lens magnification ratio
  • text: barcode value
  • exposureAdjustmentValue: exposure coefficient
  • formatValue: barcode format
  • ResultPoint: coordinates of barcode corners
  • sceneType: scenario type
  • parserDic: data returned in the corresponding scenario, including:
    • Contact: contact information
    • Email: email address
    • WebSite: URL
    • ISBN
    • Location: location information
    • SMS: SMS information
    • Tel: phone number
    • EVENT: calendar event
    • Wi-Fi: Wi-Fi information

defaultScanImagePickerDelegateForImage

Delegate method for returning image recognition result data.

Declaration

-(void)defaultScanImagePickerDelegateForImage:(UIImage *)image

initDefaultScanWithFormatType

Sets barcode format options.

Declaration

-(instancetype)initDefaultScanWithFormatType:(HmsScanOptions *)scanOptions

Set the options parameter and initialize ScanViewController.

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

Name

Description

Photo

Specifies whether the camera mode or image mode is used. Value FALSE indicates the camera mode.

ScanFormatType

ALL is an enumeration-type parameter. You can use bitwise operators to concatenate different barcode formats, for example, QR_CODE | AZTEC.