Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ BarcodeScanner provides a set of UI elements that you can easily customize.
- Camera toggle button: A clickable button that switches the front/back-facing camera.
- Close button: Stops barcode scanning and returns to the previous activity.

## Work with Foundational APIs

<div class="sample-code-prefix"></div>
>- Objective-C
Expand All @@ -52,31 +51,3 @@ cameraView?.cameraToggleButtonVisible = true
- [`CameraView`]({{ site.dce_ios }}auxiliary-api/dcecameraview.html)
- [setTorchButtonVisible]({{ site.dce_ios }}auxiliary-api/dcecameraview.html#settorchbuttonvisible)
- [setCameraToggleButtonVisible]({{ site.dce_ios }}auxiliary-api/dcecameraview.html#setcameratogglebuttonvisible)

## Work with BarcodeScanner APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
config.isTorchButtonVisible = YES;
config.isCloseButtonVisible = YES;
config.isCameraToggleButtonVisible = YES;
```
2.
```swift
let config = BarcodeScannerConfig()
config.isTorchButtonVisible = true
config.isCloseButtonVisible = true
config.isCameraToggleButtonVisible = true
```

**Related APIs**

- [`BarcodeScannerConfig`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html)
- [setTorchButtonVisible]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#settorchbuttonvisible)
- [setCloseButtonVisible]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setclosebuttonvisible)
- [setCameraToggleButtonVisible]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setcameratogglebuttonvisible)
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Specify barcode formats using a combined value of [`EnumBarcodeFormat`]({{ site.
- Use `EnumBarcodeFormat.BF_ALL` to enable all supported formats.
- Use group values like `EnumBarcodeFormat.BF_ONED` when appropriate.

### Use Foundational API

- `SimplifiedCaptureVisionSettings.barcodeSettings.barcodeFormatIds`

Example:
Expand Down Expand Up @@ -57,32 +55,6 @@ do {
}
```

### Use BarcodeScanner API

- `BarcodeScannerConfig.setBarcodeFormats(long format)`

Example:

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
// QR Code + DataMatrix
config.barcodeFormats = DSBarcodeFormatQRCode | DSBarcodeFormatDataMatrix;
```
2.
```swift
let config = BarcodeScannerConfig()
// QR Code + DataMatrix
config.barcodeFormats = [.qrCode, .dataMatrix]
```

> [!Note]
> If you are already using a customized template, you usually do not need to specify formats again in code. See [Use a Customized Template](parameters-and-templates.md#use-a-customized-template) for details.

## Configure Formats in a Template

Barcode formats are specified in `BarcodeFormatIds` under `BarcodeReaderTaskSettingOptions`. For example:
Expand Down
26 changes: 0 additions & 26 deletions programming/objectivec-swift/user-guide/capabilities/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ noTitleIndex: true

Trigger a beep sound or vibration when a barcode is scanned successfully.

### Use Foundational APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
Expand All @@ -32,27 +30,3 @@ Feedback.vibrate()
**Related API**

- [`Feedback`]({{ site.dce_ios }}auxiliary-api/dcefeedback.html)

### Use BarcodeScanner APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
config.isBeepEnabled = YES;
config.isVibrateEnabled = YES;
```
2.
```swift
let config = BarcodeScannerConfig()
config.isVibrateEnabled = true
config.isBeepEnabled = true
```

**Related API**

- [`isVibrateEnabled`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#isvibrateenabled)
- [`isBeepEnabled`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#isbeepenabled)
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ needAutoGenerateSidebar: true

## Set a Scan Region on Camera

### Work with Foundational APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
Expand Down Expand Up @@ -42,39 +40,6 @@ try? dce.setScanRegion(region)
- [`CameraEnhancer`]({{ site.dbr_ios_api }}camera-enhancer/camera-enhancer.html)
- [`setScanRegion`]({{ site.dbr_ios_api }}camera-enhancer/camera-enhancer.html#setscanregion)

### Work with BarcodeScanner APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
// Margin left 15%, margin top 30%, margin right 85%, margin bottom 70%
DSRect *region = [[DSRect alloc] init];
region.left = 0.15;
region.top = 0.25;
region.right = 0.85;
region.bottom = 0.65;
config.scanRegion = region;
```
2.
```swift
let config = BarcodeScannerConfig()
let region = Rect()
region.left = 0.15
region.top = 0.30
region.right = 0.85
region.bottom = 0.70
config.scanRegion = region
```

**Related APIs**

- [`BarcodeScannerConfig`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html)
- [`setScanRegion`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setscanregion)

## Set an ROI via Simplified Settings

> [!Important]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ noTitleIndex: true

This article explains how to switch between single-barcode scanning mode and multi-barcode scanning mode.

## Work with Foundational APIs

### Configure Expected Barcodes Count
## Configure Expected Barcodes Count

- `expectedBarcodesCount` = 1: Scan a single barcode.
- `expectedBarcodesCount` = 0: Allows the library to return more than one result, but it does not aggressively optimize for decoding multiple barcodes.
Expand Down Expand Up @@ -48,7 +47,7 @@ do {
- [`simplifiedCaptureVisionSettings`]({{ site.dcvb_ios_api }}capture-vision-router/auxiliary-classes/simplified-capture-vision-settings.html)
- [`simplifiedBarcodeReaderSettings`]({{ site.dbr_ios_api }}simplified-barcode-reader-settings.html)

### Improve Multi-Scan Stability
## Improve Multi-Scan Stability

Use max overlapping feature of multi-frame cross filter to improve the stability of multi-barcode scanning.

Expand All @@ -72,104 +71,3 @@ filter.setMaxOverlappingFrames(.barcode, frames: 10)
filter.enableLatestOverlapping(.barcode, isEnabled: true)
cvr.addResultFilter(filter)
```

## Work with BarcodeScanner APIs

### How to Switch Scanning Modes

Use the `setScanningMode` method to switch between single-barcode and multi-barcode scanning modes.

- `SM_MULTIPLE`: Multi-barcode scanning mode.
- `SM_SINGLE`: (Default) Single-barcode scanning mode.

**Code Snippet**

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
config.scanningMode = DSScanningModeMultiple;
```
2.
```swift
let config = BarcodeScannerConfig()
config.scanningMode = .multiple
```

### Configure the Auto-Stop Conditions

For multi-barcode scanning, there are two automatic stop conditions:

- The number of successfully decoded barcodes reaches the `expectedBarcodesCount`.
- There are no new decoding results for N consecutive frames. The value of N can be set using `setMaxConsecutiveStableFramesToExit`.

For example, apply the following settings:

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
config.scanningMode = DSScanningModeMultiple;
config.expectedBarcodesCount = 10;
config.maxConsecutiveStableFramesToExit = 15;
```
2.
```swift
let config = BarcodeScannerConfig()
config.scanningMode = .multiple
config.expectedBarcodesCount = 10
config.maxConsecutiveStableFramesToExit = 15
```

If at least 10 barcodes are decoded, scanning stops. Otherwise, scanning continues for up to 15 consecutive stable frames. If no new decoding results are found within those 15 frames, scanning stops.

**Related APIs**

- [`setScanningMode`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setscanningmode)
- [`setExpectedBarcodesCount`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setexpectedbarcodescount)
- [`setMaxConsecutiveStableFramesToExit`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setmaxconsecutivestableframestoexit)

## Comparisons

If you are looking for a solution to scan large batches of barcodes, refer to [`BatchBarcodeScanner`](https://www.dynamsoft.com/use-cases/batch-barcode-scanning/){:target="_blank"}. `BatchBarcodeScanner` is much more capable of large-volume barcode scanning and provides a highly interactive UI for previewing, editing, saving, reusing, and sharing results.

<table style = "text-align:left">
<thead>
<tr>
<th nowrap="nowrap"></th>
<th nowrap="nowrap">BarcodeScanner Single Mode</th>
<th nowrap="nowrap">BarcodeScanner Multi Mode</th>
<th nowrap="nowrap">BatchBarcodeScanner</th>
</tr>
</thead>
<tr>
<td style="vertical-align:text-top">Dependencies</td>
<td style="vertical-align:text-top">DynamsoftBarcodeReaderBundle</td>
<td style="vertical-align:text-top">DynamsoftBarcodeReaderBundle</td>
<td style="vertical-align:text-top">DynamsoftBatchBarcodeReaderBundle</td>
</tr>
<tr>
<td style="vertical-align:text-top">Scan Ability</td>
<td style="vertical-align:text-top">Decodes at least one barcode available in the latest frame.</td>
<td style="vertical-align:text-top">Decodes all barcodes available in the latest frame.</td>
<td style="vertical-align:text-top">Decodes all barcodes available in the latest frame (TTL Overlap Mode)<br>or<br>decodes all barcodes available in the first frame (TTS Overlap Mode)<br>or<br>decodes all barcodes that appear during capture (Panorama Mode).</td>
</tr>
<tr>
<td style="vertical-align:text-top">Result</td>
<td style="vertical-align:text-top">Always returns one barcode result. If more than one barcode is decoded, users are asked to select one.</td>
<td style="vertical-align:text-top">All decoded barcodes</td>
<td style="vertical-align:text-top">All decoded barcodes, plus a PanoramicImage that highlights all of them.</td>
</tr>
<tr>
<td style="vertical-align:text-top">Result Editor</td>
<td style="vertical-align:text-top">Not available</td>
<td style="vertical-align:text-top">Not available</td>
<td style="vertical-align:text-top">Supports the following operations<br>1. Extend the current result with all available image sources.<br>2. Manually add new results or edit existing results.<br>3. Save to history.<br>4. Export as files (.png, .csv, etc.).</td>
</tr>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Enable auto-zoom so the camera can zoom in automatically.
<p>Auto Zoom</p>
</div>

### Use Foundational APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
Expand All @@ -43,31 +41,9 @@ dce.enableEnhancedFeatures(EnhancedFeatures.autoZoom)

- [`enableEnhancedFeatures`]({{ site.dce_ios }}primary-api/camera-enhancer.html#enableenhancedfeatures)

### Use BarcodeScanner APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
config.isAutoZoomEnabled = YES;
```
2.
```swift
let config = BarcodeScannerConfig()
config.isAutoZoomEnabled = true
```

**Related API**

- [`setAutoZoomEnabled`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setautozoomenabled)

## Zoom Factor

### Use Foundational APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
Expand All @@ -84,24 +60,3 @@ dce.setZoomFactor(2.0)
**Related API**

- [`setZoomFactor`]({{ site.dce_ios }}primary-api/camera-enhancer.html#setzoomfactor)

### Use BarcodeScanner APIs

<div class="sample-code-prefix"></div>
>- Objective-C
>- Swift
>
>1.
```objc
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
config.zoomFactor = 2.0;
```
2.
```swift
let config = BarcodeScannerConfig()
config.zoomFactor = 2.0
```

**Related API**

- [`setZoomFactor`]({{ site.dbr_ios_api }}barcode-scanner/barcode-scanner-config.html#setzoomfactor)