<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kevin</title>
    <description>The latest articles on Forem by Kevin (@sb_kevin).</description>
    <link>https://forem.com/sb_kevin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1681531%2Fa9c8def2-fcf6-4493-86cf-8d2e50675c93.png</url>
      <title>Forem: Kevin</title>
      <link>https://forem.com/sb_kevin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sb_kevin"/>
    <language>en</language>
    <item>
      <title>Try the Integration Challenge – run our Android SDK in 10 minutes or less</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Wed, 17 Jul 2024 14:21:11 +0000</pubDate>
      <link>https://forem.com/scanbot-sdk/try-the-integration-challenge-run-our-android-sdk-in-10-minutes-or-less-nob</link>
      <guid>https://forem.com/scanbot-sdk/try-the-integration-challenge-run-our-android-sdk-in-10-minutes-or-less-nob</guid>
      <description>&lt;p&gt;Did you visit Droidcon 2024 in Berlin? If so, you may have noticed our Integration Challenge, for which we asked developers to integrate our Barcode Scanner SDK for Android in less than 10 minutes.&lt;/p&gt;

&lt;p&gt;40 people tried to do so. All of them managed it in less than 6 minutes, with the best time clocking in at incredible 1:02! 🤯&lt;/p&gt;

&lt;p&gt;Can you top that? Let’s find out – we’ve added the instructions to our &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/android/quick-start/" rel="noopener noreferrer"&gt;Quick Start Guide&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;⏱️ If you want to see how fast you can do it, start your clock when you scroll down.&lt;/p&gt;

&lt;p&gt;Let’s go through the steps one by one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Clone the template app (or create a project from scratch)
&lt;/h2&gt;

&lt;p&gt;We’ve prepared a template project so you won’t waste any time on building a UI. You can clone or download it from our &lt;a href="https://github.com/doo/scanbot-barcode-sdk-integration-challenge" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Open the project in Android Studio and you’re good to go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Add the Scanbot SDK dependencies
&lt;/h2&gt;

&lt;p&gt;The Scanbot SDK for Android is distributed through our private Maven repository server (&lt;code&gt;nexus.scanbot.io&lt;/code&gt;), which needs to be specified in the &lt;code&gt;settings.gradle.kts&lt;/code&gt; file in the root folder of your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// settings.gradle.kts in the root of the project:
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()

        // Add Scanbot SDK maven repositories here:
        maven(url = "https://nexus.scanbot.io/nexus/content/repositories/releases/")
        maven(url = "https://nexus.scanbot.io/nexus/content/repositories/snapshots/")
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterward, the dependencies can be added in the &lt;code&gt;dependencies&lt;/code&gt; section of your Android application project configuration, usually in the &lt;code&gt;app/build.gradle.kts&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// app/build.gradle.kts (dependencies section):
implementation("io.scanbot:scanbot-barcode-scanner-sdk:5.2.0")
implementation("io.scanbot:rtu-ui-v2-barcode:5.2.0")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check out the latest version of the Scanbot SDK, please always refer to the SDK’s &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/android/changelog/" rel="noopener noreferrer"&gt;changelog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For more details on the dependencies, please refer to our &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/android/detailed-setup-guide/installation/" rel="noopener noreferrer"&gt;detailed installation&lt;/a&gt; guide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Add the camera permission​
&lt;/h2&gt;

&lt;p&gt;The Scanbot Barcode Scanner SDK needs access to the device camera so it can scan from a live camera stream. Therefore, you have to define the camera permission in the &lt;code&gt;AndroidManifest.xml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- AndroidManifest.xml: --&amp;gt;
&amp;lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" ...&amp;gt;

    &amp;lt;!-- Add Camera permission here: --&amp;gt;
    &amp;lt;uses-permission android:name="android.permission.CAMERA" /&amp;gt;
    &amp;lt;uses-feature android:name="android.hardware.camera" /&amp;gt;

    &amp;lt;application ...&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note how we also added the &lt;code&gt;uses-feature&lt;/code&gt; tag for better recognition of your app on the Google Play Store (&lt;a href="https://developer.android.com/guide/topics/manifest/uses-feature-element" rel="noopener noreferrer"&gt;see the Android documentation&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Our Ready-to-Use UI Components handle the &lt;a href="https://developer.android.com/training/permissions/requesting" rel="noopener noreferrer"&gt;runtime permissions&lt;/a&gt; automatically, so there is no need to add anything else in the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Initialize the SDK
&lt;/h2&gt;

&lt;p&gt;Usually, we recommend initializing the SDK in the Application class of your app (see our &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/android/detailed-setup-guide/sdk-initialization/" rel="noopener noreferrer"&gt;detailed setup&lt;/a&gt; page). However, in this Quick Start guide, we’ll do it in an &lt;code&gt;Activity&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;First, make sure to add the following imports to the top of the file (e.g., &lt;code&gt;MainActivity.kt&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Add the following imports in your Activity (for example, MainActivity.kt):
import android.widget.Toast
import androidx.activity.result.ActivityResultLauncher
import io.scanbot.sdk.barcode_scanner.ScanbotBarcodeScannerSDKInitializer
import io.scanbot.sdk.ui_v2.barcode.BarcodeScannerActivity
import io.scanbot.sdk.ui_v2.barcode.configuration.BarcodeScannerConfiguration
import io.scanbot.sdk.ui_v2.common.activity.registerForActivityResultOk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To initialize the SDK, simply use the &lt;code&gt;ScanbotBarcodeScannerSDKInitializer&lt;/code&gt; class in the &lt;code&gt;onCreate&lt;/code&gt; method of your &lt;code&gt;Activity&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Adapt your Activity's onCreate method as follows:
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    ...
    // Initialize the SDK here:
    ScanbotBarcodeScannerSDKInitializer()
        // optional: uncomment the next line if you have a license key
        // .license(this.application, LICENSE_KEY)
        .initialize(this.application)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 You can use the Scanbot Barcode SDK for quick testing or evaluation purposes even without a license key. However, the SDK will only work for 60 seconds per app session and may not be used for production purposes. Want to scan longer than 60 seconds? Get your free trial license key &lt;a href="https://scanbot.io/trial/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 5: Start the Barcode Scanner and process the result​
&lt;/h2&gt;

&lt;p&gt;You only need a few lines of code to integrate the Scanbot Barcode Scanner UI (&lt;code&gt;BarcodeScannerActivity&lt;/code&gt;) into your application’s workflow. It’s as simple as starting a regular Android &lt;code&gt;Activity&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;First, you need to register the &lt;code&gt;ActivityResultLauncher&lt;/code&gt; in your &lt;code&gt;Activity&lt;/code&gt; class and save it as a variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Add the following variable in your Activity:
private val barcodeScreenLauncher: ActivityResultLauncher&amp;lt;BarcodeScannerConfiguration&amp;gt; =
    registerForActivityResultOk(BarcodeScannerActivity.ResultContract()) { resultEntity -&amp;gt;
        // Barcode Scanner result callback:
        // Get the first scanned barcode from the result object...
        val barcodeItem = resultEntity.result?.items?.first()
        // ... and process the result as needed, for example, display as a Toast:
        Toast.makeText(
            this,
            "Scanned: ${barcodeItem?.text} (${barcodeItem?.type})",
            Toast.LENGTH_LONG
        ).show()
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of the Barcode Scanner UI will be delivered to the callback you just defined.&lt;/p&gt;

&lt;p&gt;Now, to launch the Barcode Scanner UI, you just call the &lt;code&gt;barcodeScreenLauncher&lt;/code&gt; where needed. For example, in the &lt;code&gt;setOnClickListener&lt;/code&gt; of your button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Launch the barcode scanner in your Activity:
barcodeScreenLauncher.launch(BarcodeScannerConfiguration())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🚀 That’s it! 🚀 You have successfully integrated a full-featured barcode scanner as an RTU UI Activity into your app. If you’d like, let us know what your time was!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Customization: In this Quick Start guide, we have used the default configuration for the scanner UI. Feel free to explore the configs and customize the UI and the behavior according to your needs via the &lt;code&gt;BarcodeScannerConfiguration&lt;/code&gt; class. For more details, please refer to the &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/android/barcode-scanner/ready-to-use-ui/" rel="noopener noreferrer"&gt;Ready-to-Use UI&lt;/a&gt; page.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Integrating a barcode scanner into your iOS app – the easy way</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Fri, 28 Jun 2024 11:25:46 +0000</pubDate>
      <link>https://forem.com/scanbot-sdk/integrating-a-barcode-scanner-sdk-into-your-ios-app-the-easy-way-18ei</link>
      <guid>https://forem.com/scanbot-sdk/integrating-a-barcode-scanner-sdk-into-your-ios-app-the-easy-way-18ei</guid>
      <description>&lt;p&gt;&lt;em&gt;Want to integrate barcode scanning functionalities into your iOS app? With our Ready-to-Use UI, this only takes you a few minutes. We’ll show you how it works!&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Setting up a simple app that can scan any 1D or 2D barcode is very straightforward – all we need are the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a project&lt;/li&gt;
&lt;li&gt;Install the SDK&lt;/li&gt;
&lt;li&gt;Set up the main screen&lt;/li&gt;
&lt;li&gt;Implement the scanning modes&lt;/li&gt;
&lt;li&gt;Build, run, and scan!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After that, you will be scanning barcodes with lightning speed! ⚡&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxr86lww4t4lslc1z289.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxr86lww4t4lslc1z289.gif" alt="Image description" width="320" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;All you need for this project is the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;macOS with Xcode 14.0 or higher&lt;/li&gt;
&lt;li&gt;A test device, since we’ll need to use the camera (minimum deployment target: iOS 13.0)&lt;/li&gt;
&lt;li&gt;Basic knowledge of how to build an iOS app&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Our iOS Barcode Scanner SDK supports both Swift and Objective-C, but we’ll stick to Swift for this tutorial.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Preparing the project
&lt;/h2&gt;

&lt;p&gt;First, we’re going to create a new Swift project with the Storyboard interface.&lt;/p&gt;

&lt;p&gt;To create the project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Xcode and click on &lt;strong&gt;Create New Project…&lt;/strong&gt; (or go to &lt;strong&gt;File -&amp;gt; New -&amp;gt; Project…&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Make sure you have the &lt;strong&gt;iOS&lt;/strong&gt; tab selected, then choose &lt;strong&gt;App&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Give it a name, e.g., MyBarcodeScanningApp.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Storyboard&lt;/strong&gt; as the interface.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Swift&lt;/strong&gt; as the programming language.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next, we’ll install the Barcode Scanner SDK package.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing the SDK
&lt;/h2&gt;

&lt;p&gt;For this tutorial, we will use the &lt;a href="https://developer.apple.com/documentation/xcode/swift-packages"&gt;Swift Package Manager&lt;/a&gt; to install the Barcode Scanner SDK.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In Xcode, go to &lt;strong&gt;File -&amp;gt; Add Package Dependencies…&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Paste the following package URL into the search bar: &lt;a href="https://github.com/doo/scanbot-barcode-scanner-sdk-ios-spm.git"&gt;https://github.com/doo/scanbot-barcode-scanner-sdk-ios-spm.git&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Select the package and click &lt;strong&gt;Add Package&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the pop-up that appears after verification, for “Add to Target”, choose your project.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add Package&lt;/strong&gt; again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jWcyrsNX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://scanbot.io/wp-content/uploads/2024/06/ios-barcode-scanner-sdk-integration-tutorial-add-package-gif-2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jWcyrsNX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://scanbot.io/wp-content/uploads/2024/06/ios-barcode-scanner-sdk-integration-tutorial-add-package-gif-2.gif" alt="Image description" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Without a license key, our SDK only runs for 60 seconds per session. This is more than enough for the purposes of our tutorial, but if you like, you can &lt;a href="https://scanbot.io/trial/"&gt;generate a license key here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For more information about where to put the license key in your code, please refer to &lt;a href="https://docs.scanbot.io/document-scanner-sdk/ios/sdk-initialization/"&gt;SDK Initialization&lt;/a&gt; in our docs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We’ll need access to the device camera to scan barcodes, so let’s set the corresponding privacy property now.&lt;/p&gt;

&lt;p&gt;In the project navigator, select your project, then select your app under “TARGETS”. Open the tab &lt;strong&gt;Info&lt;/strong&gt;, add the target property &lt;strong&gt;Privacy – Camera Usage Description&lt;/strong&gt;, and type in a meaningful value, e.g., “Grant access to your camera to start scanning”.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating the scanning functionalities
&lt;/h2&gt;

&lt;p&gt;Now that the project is set up, integrating barcode scanning into your app is very straightforward.&lt;/p&gt;

&lt;p&gt;In fact, it’s so straightforward that we’ll implement not just one, but &lt;strong&gt;three different scanning modes&lt;/strong&gt; in our project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single-barcode scanning:&lt;/strong&gt; Read and show the value of a single barcode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-barcode scanning:&lt;/strong&gt; Read as many barcodes as you like and display their values in a list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AR overlay:&lt;/strong&gt; Display the values of the barcodes in the viewfinder on the screen in real time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s how we’re going to achieve that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; Set up the main screen (create three buttons and connect them to our View Controller)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt; Implement the scanning modes (copy and paste the code for the three scanning modes into the @IBAction functions)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2.5 (optional):&lt;/strong&gt; Customize the scanning UI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 3:&lt;/strong&gt; Start scanning 🤳&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s dive right in!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Setting up the main screen
&lt;/h2&gt;

&lt;p&gt;How exactly you approach this is up to you, but for the sake of this tutorial, we will just add three &lt;code&gt;UIButton&lt;/code&gt; elements (“Single-Barcode Scanning”, “Multi-Barcode Scanning”, and “AR Overlay”) onto the View Controller Scene in &lt;strong&gt;Main.storyboard&lt;/strong&gt;. Then, we connect them as an &lt;strong&gt;Action&lt;/strong&gt; to &lt;strong&gt;ViewController.swift&lt;/strong&gt; by dragging them while holding the &lt;strong&gt;control&lt;/strong&gt; key.&lt;/p&gt;

&lt;p&gt;For our purposes, let’s call the resulting &lt;code&gt;@IBAction&lt;/code&gt; functions “startSingleScanning”, “startMultiScanning”, and “startAROverlay”.&lt;/p&gt;

&lt;p&gt;We also need to import the ScanbotBarcodeScannerSDK package like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ScanbotBarcodeScannerSDK

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the next step, we’ll add the code to get our scanning interface up and running into those functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Implementing the scanning modes
&lt;/h2&gt;

&lt;p&gt;Thanks to our &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/ios/barcode-scanner/ready-to-use-ui/"&gt;RTU UI components&lt;/a&gt;, integrating our Barcode Scanner SDK’s features into your app is a breeze!&lt;/p&gt;

&lt;p&gt;In fact, you can just copy and paste the code from our &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/ios/barcode-scanner/ready-to-use-ui/#use-cases"&gt;documentation&lt;/a&gt; 🦥&lt;/p&gt;

&lt;p&gt;Here’s the code to put in each function for your convenience:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For single-barcode scanning:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
    @IBAction func startSingleScanning(_ sender: Any) {
        // Create the default configuration object.
        // Create the default configuration object.
        let configuration = SBSDKUI2BarcodeScannerConfiguration()

        // Initialize the single-scan use case.
        let singleUsecase = SBSDKUI2SingleScanningMode()

        // Enable and configure the confirmation sheet.
        singleUsecase.confirmationSheetEnabled = true
        singleUsecase.sheetColor = SBSDKUI2Color(colorString: "#FFFFFF")

        // Hide/unhide the barcode image of the confirmation sheet.
        singleUsecase.barcodeImageVisible = true

        // Configure the barcode title of the confirmation sheet.
        singleUsecase.barcodeTitle.visible = true
        singleUsecase.barcodeTitle.color = SBSDKUI2Color(colorString: "#000000")

        // Configure the barcode subtitle of the confirmation sheet.
        singleUsecase.barcodeSubtitle.visible = true
        singleUsecase.barcodeSubtitle.color = SBSDKUI2Color(colorString: "#000000")

        // Configure the cancel button of the confirmation sheet.
        singleUsecase.cancelButton.text = "Close"
        singleUsecase.cancelButton.foreground.color = SBSDKUI2Color(colorString: "#C8193C")
        singleUsecase.cancelButton.background.fillColor = SBSDKUI2Color(colorString: "#00000000")

        // Configure the submit button of the confirmation sheet.
        singleUsecase.submitButton.text = "Submit"
        singleUsecase.submitButton.foreground.color = SBSDKUI2Color(colorString: "#FFFFFF")
        singleUsecase.submitButton.background.fillColor = SBSDKUI2Color(colorString: "#C8193C")

        // Set the configured use case.
        configuration.useCase = singleUsecase

        // Create and set an array of accepted barcode formats.
        configuration.recognizerConfiguration.barcodeFormats = SBSDKUI2BarcodeFormat.twoDFormats

        // Present the recognizer view controller modally on this view controller.
        SBSDKUI2BarcodeScannerViewController.present(on: self,
                                                     configuration: configuration) { controller, cancelled, error, result in

            // Completion handler to process the result.
            // The `cancelled` parameter indicates whether the cancel button was tapped.

            controller.presentingViewController?.dismiss(animated: true)
        }
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For multi-barcode scanning:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
    @IBAction func startMultiScanning(_ sender: Any) {
        // Create the default configuration object.
        let configuration = SBSDKUI2BarcodeScannerConfiguration()

        // Initialize the multi-scan use case.
        let multiUsecase = SBSDKUI2MultipleScanningMode()

        // Set the counting repeat delay.
        multiUsecase.countingRepeatDelay = 1000

        // Set the counting mode.
        multiUsecase.mode = .counting

        // Set the sheet mode of the barcodes preview.
        multiUsecase.sheet.mode = .collapsedSheet

        // Set the height of the collapsed sheet.
        multiUsecase.sheet.collapsedVisibleHeight = .large

        // Enable manual count change.
        multiUsecase.sheetContent.manualCountChangeEnabled = true

        // Configure the submit button.
        multiUsecase.sheetContent.submitButton.text = "Submit"
        multiUsecase.sheetContent.submitButton.foreground.color = SBSDKUI2Color(colorString: "#000000")

        // Set the configured use case.
        configuration.useCase = multiUsecase

        // Create and set an array of accepted barcode formats.
        configuration.recognizerConfiguration.barcodeFormats = SBSDKUI2BarcodeFormat.twoDFormats

        // Present the recognizer view controller modally on this view controller.
        SBSDKUI2BarcodeScannerViewController.present(on: self,
                                                     configuration: configuration) { controller, cancelled, error, result in

            // Completion handler to process the result.
            // The `cancelled` parameter indicates whether the cancel button was tapped.

            controller.presentingViewController?.dismiss(animated: true)
        }
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For the AR overlay:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
    @IBAction func startAROverlay(_ sender: Any) {
        // Create the default configuration ject.
        let configuration = SBSDKUI2BarcodeScannerConfiguration()

        // Configure the usecase.
        let usecase = SBSDKUI2MultipleScanningMode()
        usecase.mode = .unique
        usecase.sheet.mode = .collapsedSheet
        usecase.sheet.collapsedVisibleHeight = .small

        // Configure AR Overlay.
        usecase.arOverlay.visible = true
        usecase.arOverlay.automaticSelectionEnabled = false

        // Set the configured usecase.
        configuration.useCase = usecase

        // Create and set an array of accepted barcode formats.
        configuration.recognizerConfiguration.barcodeFormats = SBSDKUI2BarcodeFormat.twoDFormats

        // Present the recognizer view controller modally on this view controller.
        SBSDKUI2BarcodeScannerViewController.present(on: self,
                                                     configuration: configuration) { controller, cancelled, error, result in

            // Completion handler to process the result.
            // The `cancelled` parameter indicates whether the cancel button was tapped.

            controller.presentingViewController?.dismiss(animated: true)
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There’s one tiny thing we’ll change here right away, though: We want to be able to scan both 1D and 2D barcode formats. &lt;/p&gt;

&lt;p&gt;For this, let’s go to &lt;code&gt;configuration.recognizerConfiguration.barcodeFormats&lt;/code&gt; in each &lt;code&gt;@IBAction&lt;/code&gt; function and change &lt;code&gt;SBSDKUI2BarcodeFormat.twoDFormats&lt;/code&gt; to &lt;code&gt;SBSDKUI2BarcodeFormat.commonFormats&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s now explore some of the other customization options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2.5 (optional): Customizing the scanning UI
&lt;/h2&gt;

&lt;p&gt;Our RTU UI not only makes it very easy to integrate our SDK’s scanning functionalities, but also to style the UI elements in any way you like 🎨&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bjcp06xq1lfeebvfx0z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bjcp06xq1lfeebvfx0z.jpg" alt="Image description" width="396" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Well, maybe not in ANY way. Sorry, Bob.)&lt;/p&gt;

&lt;p&gt;The comments already give you a hint about what’s possible to change:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hide or show specific UI elements&lt;/li&gt;
&lt;li&gt;Configure the active and inactive states of some UI elements&lt;/li&gt;
&lt;li&gt;Change colors&lt;/li&gt;
&lt;li&gt;Change titles and subtitles&lt;/li&gt;
&lt;li&gt;Change the accepted barcode formats&lt;/li&gt;
&lt;li&gt;Control the barcode sheet behavior for multi-scanning&lt;/li&gt;
&lt;li&gt;… and more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As an example, let’s take a closer look at some of the configuration options of our multi-barcode scanning feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Set the counting mode.
multiUsecase.mode = .counting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we can change &lt;code&gt;.counting&lt;/code&gt; to &lt;code&gt;.unique&lt;/code&gt;. This will prevent the SDK from scanning multiple barcodes with the same value, which is helpful if you only want to count the number of &lt;em&gt;unique&lt;/em&gt; barcodes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Set the sheet mode of the barcodes preview.
multiUsecase.sheet.mode = .collapsedSheet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change &lt;code&gt;.collapsedSheet&lt;/code&gt; to &lt;code&gt;.button&lt;/code&gt; to not show the upper part of the barcode results sheet at the bottom of the screen and display a button that calls up the sheet instead.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 You can change the entire RTU UI’s color scheme using the &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/ios/barcode-scanner/ready-to-use-ui/#palette"&gt;palette feature&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you’ve made your changes, build and run your app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Scanning some barcodes!
&lt;/h2&gt;

&lt;p&gt;Now you can go ahead and scan 1D and 2D barcodes – one after the other, many at the same time, and even with an AR overlay that lets you preview their values!&lt;/p&gt;

&lt;p&gt;If you’re in need of some barcodes, we’ve got you covered:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi75alcu7wqiaxt7nkwtx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi75alcu7wqiaxt7nkwtx.png" alt="Image description" width="632" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this tutorial has piqued your interest in integrating barcode scanning functionalities into your iOS app, make sure to take a look at our SDK’s other features in our &lt;a href="https://docs.scanbot.io/barcode-scanner-sdk/ios/barcode-scanner/ready-to-use-ui/"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
