BarcodeScanner
is used as a library within a project. There are four classes available for use:
ATGOverlayView
A class, Custom drawing, for the scanning view.
ATGBarcodeScannerViewController
A class that manages the scanning view.
ATGBarcodeScannerHandler
This class is an interface used to obtain a single instance of the scanner.
ATGBarcodeScannerHandlerDelegate
This class is an interface for callback handling from the scanner/parser. The class that initializes the scanning process is responsible for ensuring that the delegate implements and registers the instance using ATGBarcideScannerHandler
.
Search by sku.repositoryId
is supported, so the BarcodeScanner
simply returns the scanned barcode and lets the main app handle the search/rendering of the parsed result.
ATGOverlayView Interface
// Values: OneD, TwoD, DataMatrix - enum BarcodeScannerMode // Parameter pModes is NOT mutually exclusive. That is, passed in values can be OR'd together. - (id)initWithModes:(BarcodeScannerMode)pModes;
ATGBarcodeScannerViewController Interface
(id)initWithDelegate:(id<ZXingDelegate>)delegate modes:(BarcodeScannerMode)pModes;
ATGBarcodeScannerHandler Interface
// Handler is a singleton value. However, the delegate can be updated/changed by invoking this method with the desired callback listener. + (ATGBarcodeScannerHandler *)initWithDelegate:(id<ATGBarcodeScannerHandlerDelegate>)pDelegate; // Launches the scanner screen that handles the scanning/parsing of barcodes. // Method invoker is responsible for presenting the returned view controller. - (ATGBarcodeScannerViewController *)performBarcodeScan;
ATGBarcodeScannerHandlerDelegate Interface
The callback handler is responsible for dealing with the passed in view controller, including dismissing it.
- (void)didSuccessfullyParseScan:(ParsedResult *)pParsedResult withController:(UIViewController *)pViewController; - (void)didCancelScanRequest:(UIViewController *)scannerViewController;