SBSDKUIBarcodeFilter
@interface SBSDKUIBarcodeFilter : NSObject
A class for a barcode filtering that can be used in barcode scanning RTU-UI components. You can customize the filtering of barcode results coming from RTU-UI barcode scanners by implementing a subclass of this class and pass the instance of your filtering class to the barcode scanning RTU-UI component.
-
Accepts or rejects a scanned barcode.
Declaration
Objective-C
- (BOOL)acceptsBarcode:(nonnull SBSDKBarcodeScannerResult *)barcode;
Swift
func acceptsBarcode(_ barcode: SBSDKBarcodeScannerResult) -> Bool
Parameters
barcode
The barcode to be accepted or rejected by the filter.
Return Value
YES if the given barcode should be accepted, NO otherwise.
-
Accepts or rejects a scanned barcode in the context of already accepted barcodes. Accepts a barcodes, if it is not yet contained in the given array of accepted barcodes. Prevents duplicate barcodes.
Declaration
Objective-C
- (BOOL)shouldAdd:(nonnull SBSDKBarcodeScannerResult *)barcode toBarcodes:(nonnull NSArray<SBSDKBarcodeScannerResult *> *)codes;
Swift
func shouldAdd(_ barcode: SBSDKBarcodeScannerResult, toBarcodes codes: [SBSDKBarcodeScannerResult]) -> Bool
Parameters
barcode
The barcode to be accepted or rejected by the filter.
codes
List of current already accepted barcodes.
Return Value
YES if the given barcode should be accepted, NO otherwise.