Barcode Pick Async Mapper Product Provider

Defined in framework ScanditBarcodeCapture

Note

Barcode Pick is still in beta and may change in future versions of Scandit Data Capture SDK.

SDCBarcodePickAsyncMapperProductProvider
@interface SDCBarcodePickAsyncMapperProductProvider : NSObject <SDCBarcodePickProductProvider>

Added in version 6.19.0

A product provider that takes on construction a list of products to pick and a delegate

Usage example:

let products: Set<BarcodePickProduct> = [
  .init(identifier: "780846124122", quantityToPick: 2),
  .init(identifier: "750865926478", quantityToPick: 1),
  .init(identifier: "984579832123", quantityToPick: 4)
]
let productProvider = BarcodePickAsyncMapperProductProvider(products: products,
                                                          providerDelegate: self)

...

extension ViewController: BarcodePickAsyncMapperProductProviderDelegate {
  func mapItems(_ items: [String], completionHandler: @escaping ([BarcodePickProductProviderCallbackItem]) -> Void) {
    let result: [BarcodePickProductProviderCallbackItem] = myDb.findAndMapProductsForItemsData(items)
    completionHandler(result)
  }
}

Note

Use your preferred way to retrieve the initial list of products to pick and to handle the async retrieval of products from itemsData. In this snippet we’re using a hardcoded set of products and a fictitious myDb object for simplicity’s sake.

- initWithProducts:providerDelegate:
- (instancetype)initWithProducts:(NSSet<SDCBarcodePickProduct *> *)products
                providerDelegate:(id<SDCBarcodePickAsyncMapperProductProviderDelegate>)
                                 providerDelegate

Added in version 6.19.0

Creates a new instance with the given set of SDCBarcodePickProduct and callback to map items to products asynchronously.