Table of contents
Swift
Objective-C

Configure the UI Elements

Available Buttons
Torch button
Camera toggle button
Close button (BarcodeScanner API only)

BarcodeScanner provides a set of UI elements that you can easily customize.

buttons

buttons

  • Torch button: A clickable button that turns the torch on or off.
  • Camera toggle button: A clickable button that switches the front/back-facing camera.
  • Close button: Stops barcode scanning and returns to the previous activity.
  • Objective-C
  • Swift
  1. @property (nonatomic, strong) DSCameraView *cameraView;
    self.cameraView = [[DSCameraView alloc] initWithFrame:self.view.bounds];
    [self.cameraView setTorchButtonVisible:YES];
    self.cameraView.cameraToggleButtonVisible = YES;
    
  2. let cameraView = self.cameraView
    cameraView?.torchButtonVisible = true
    cameraView?.cameraToggleButtonVisible = true
    

Related APIs

This page is compatible for: