Skip to main content

Classic UI for the iOS Text Pattern Scanner Module

The main class of this Classic UI Component is SBSDKTextPatternScannerViewController.

Usually, this view controller is embedded as a child view controller into another view controller, the parent view controller. The parent view controller usually acts as the delegate and processes the scanning results. You still have full control over the UI elements and can add additional views and buttons to your view controller. The Classic UI Component does not display results, instead, it just forwards them to the delegate.

Classic UI Example
loading...

General programming guide

Usage and initialization

The design pattern that Classic UI components are used with is called 'Embedded Child View Controller': you create your own subclass of UIViewController and in its viewDidLoad method you initialize the desired Scanbot SDK Classic UI component by calling its designated initializer and passing your view controller instance as the parent view controller.

Typically, your view controller class also acts as the delegate for the Scanbot SDK Classic component. Additionally, you can specify a view to which the component's view should be added as a subview. This may be your view controller's view (for full size) as well as any of its (smaller) subviews for a more sophisticated layout.

After creating the component's instance, you may configure it to make it work as you see fit.

The final step is the implementation of the component's delegation protocol to receive the scanned results, respond to special events, or make behavioral decisions.

Configuration

All Scanbot SDK Classic UI component classes derive from SBSDKBaseScannerViewController. This abstract base class encapsulates all of the shared functionality, e.g.

  • Camera device with preview
  • Viewfinder
  • Zooming
  • Energy management
  • Capturing still images
  • Flashlight control
  • Focus locking
  • Overlay views
  • View layout
  • User interface orientation handling

Each Classic UI component can make use of these features. Additionally, each component has its own properties and delegation protocol which are dedicated to the specific use case of the component.

Some of the features are accessible using functions and properties of SBSDKBaseScannerViewController directly, e.g. flashlight control, focus locking, camera device selection, zoom control, and still image capturing.

Complex features with multiple properties are gathered into configuration objects:

  • SBSDKBaseScannerGeneralConfiguration
  • SBSDKBaseScannerZoomConfiguration
  • SBSDKBaseScannerEnergyConfiguration
  • SBSDKBaseScannerViewFinderConfiguration

These configuration objects are accessible using the component's instances copy properties generalConfiguration, zoomConfiguration, energyConfiguration, and viewFinderConfiguration.

Important

Do not modify a configuration object directly. Since it is a copy of the component's configuration, this will have no effect. Instead, get a copy of the desired configuration object, modify it to your taste, and use the component's setter to apply the changes.

Example of how to configure these common configuration objects

Common Classic UI configurations example
loading...