Barcode Tracking Advanced Overlay
Defined in framework ScanditBarcodeCapture
Note
Using this class requires the MatrixScan AR add-on.
- SDCBarcodeTrackingAdvancedOverlay
@interface SDCBarcodeTrackingAdvancedOverlay : UIView <SDCDataCaptureOverlay>
Added in version 6.0.0
An overlay for SDCDataCaptureView that allows anchoring a single user-provided View to each tracked barcode.
The provided view is visible on the top of the camera preview as long as its tracked barcode is and for all this time retains its relative position to it. This is useful when an additional information should be provided to tracked barcodes in real time. For instance, a user may overlay the price of an item or its expiry date for each corresponding barcode.
To display the views, this overlay must be attached to a SDCDataCaptureView. This may be done either by creating it with overlayWithBarcodeTracking:forDataCaptureView: with a non-null view parameter or by passing this overlay to SDCDataCaptureView.addOverlay:.
A user of this class may configure what view is displayed for the given barcode and the relative position between the two by implementing SDCBarcodeTrackingAdvancedOverlayDelegate or by calling setView:forTrackedBarcode:, setAnchor:forTrackedBarcode: or setOffset:forTrackedBarcode:.
For additional information about using this overlay, refer to Adding AR Overlays .
- + overlayWithBarcodeTracking:forDataCaptureView:
+ (
instancetype
)overlayWithBarcodeTracking:(nonnull SDCBarcodeTracking *)barcodeTracking forDataCaptureView:(nullable SDCDataCaptureView *)viewAdded in version 6.0.0
Constructs a new barcode tracking advanced overlay for the barcode tracking instance. The overlay is automatically added to the view.
- + barcodeTrackingAdvancedOverlayFromJSONString:mode:error:
+ (nullable
instancetype
) barcodeTrackingAdvancedOverlayFromJSONString:(nonnull NSString *)JSONString mode:(nonnull SDCBarcodeTracking *)mode error:(NSError **)errorAdded in version 6.3.0
Constructs a new barcode tracking advanced overlay with the provided JSON serialization.
For the overlay to be displayed on screen, it must be added to a SDCDataCaptureView.
- delegate
@property (nonatomic, weak, nullable)
id
<SDCBarcodeTrackingAdvancedOverlayDelegate> delegateAdded in version 6.0.0
- shouldShowScanAreaGuides
@property (nonatomic, assign)
BOOL
shouldShowScanAreaGuidesAdded in version 6.7.0
Whether to show scan area guides on top of the preview. This property is useful during development to visualize the current scan areas on screen. It is not meant to be used for production. By default this property is NO.
- - setView:forTrackedBarcode:
- (
void
)setView:(nullable UIView *)view forTrackedBarcode:(nonnull SDCTrackedBarcode *)trackedBarcodeAdded in version 6.0.0
The method can be called to change the view drawn for the given tracked barcode. Setting the view to nil will unset the view from the tracked barcode and will effectively remove it from the overlay. This method is thread-safe, it can be called from any thread. The view set via this method will take precedence over the one set via SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:viewForTrackedBarcode:: in case a view is set before SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:viewForTrackedBarcode: got called, no call to SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:viewForTrackedBarcode: will happen.
Note
Images are not allowed, please contact support@scandit.com if you have any questions.
- - setAnchor:forTrackedBarcode:
- (
void
)setAnchor:(SDCAnchor)anchor forTrackedBarcode:(nonnull SDCTrackedBarcode *)trackedBarcodeAdded in version 6.0.0
The method can be called to change the anchor point for the view associated with the given tracked barcode. This method is thread-safe, it can be called from any thread. The anchor set via this method will take precedence over the one set via SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:anchorForTrackedBarcode:: in case a view is set before SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:anchorForTrackedBarcode: got called, no call to SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:anchorForTrackedBarcode: will happen.
- - setOffset:forTrackedBarcode:
- (
void
)setOffset:(SDCPointWithUnit)offset forTrackedBarcode:(nonnull SDCTrackedBarcode *)trackedBarcodeAdded in version 6.0.0
The method can be called to change the offset for the view associated with the given tracked barcode. This method is thread-safe, it can be called from any thread. The offset set via this method will take precedence over the one set via SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:offsetForTrackedBarcode:: in case a view is set before SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:offsetForTrackedBarcode: got called, no call to SDCBarcodeTrackingAdvancedOverlayDelegate.barcodeTrackingAdvancedOverlay:offsetForTrackedBarcode: will happen. If the SDCMeasureUnit of the offset is SDCMeasureUnitFraction, the offset is calculated relative to view’s dimensions.
- - clearTrackedBarcodeViews
- (
void
)clearTrackedBarcodeViewsAdded in version 6.0.0
Clears all the views for the currently tracked barcodes from this overlay. This method is thread-safe, it can be called from any thread.