Defines the global instance constant hmsCustomScanViewController. This is a barcode scanning utility class, which is used to check permissions and start the barcode scanning screen. It supports barcode scanning in Customized View mode.
Declaration
@interface HmsCustomScanViewController : UIViewController
To perform initialization in a called method, initialize the delegate method of DefaultScanView:
HmsCustomScanViewController *hmsCustomScanViewController; hmsDefaultScanViewController.defaultScanDelegate = self; hmsCustomScanViewController = [[HmsCustomScanViewController alloc] init];
Properties
Name | Description |
|---|---|
@property (nonatomic) BOOL backButtonHidden | Indicates whether to hide the back button. Example: backButtonHidden = true |
@property (nonatomic) BOOL continuouslyScan | Indicates whether to perform continuous scanning. The default value is false. The value true indicates that continuous scanning is performed. Example: continuouslyScan = true |
@property (nonatomic) CGRect cutArea | Sets an area for scanning in Customized View mode. Example: CGRectMake(50, 50, 450, 450) |
Delegate method for returning scanning result data.
Declaration
-(void)customizedScanDelegateForResult:(NSDictionary *)resultDic
Returns
Type | Description |
|---|---|
NSDictionary | NSDictionary class that contains scanning result data, including:
|
Sets barcode format options.
Declaration
-(instancetype)initCustomizedScanWithFormatType:(HmsScanOptions *)scanOptions
Set the options parameter and initialize ScanViewController.
HmsScanOptions *options = [[HmsScanOptions alloc] initWithScanFormatType:ALL Photo:FALSE]; self.hmsCustomScanViewController = [[HmsCustomScanViewController alloc] initCustomizedScanWithFormatType:options];
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. |