DOT iOS Palm 9.0.0

This guide describes how to migrate DOT iOS Palm version 8.x to version 9.0. Only the most important changes are highlighted in this guide. For more details, see the iOS Samples.

Migration Steps

Compatibility with DIS

When utilizing DIS for server-side evaluation, ensure compatibility between your DIS version and the corresponding SDK version. Refer to the DIS vs SDKs compatibility table for detailed compatibility information.

Deployment

Changed minimal required iOS version to iOS 13.0. Changed minimal required Xcode version to Xcode 16.1.

SDK initialization

The way DOT SDK libraries are configured has changed.

  • Replace DotSdkConfiguration with DotSdk.Configuration class.
  • Update libraries property of DotSdk.Configuration class.

Before

Libraries were provided as a list of DotLibrary instances.

let dotPalmLibraryConfiguration = DotPalmLibraryConfiguration(
    modules: [DotPalmDetectionModule.shared]
)

let dotSdkConfiguration = DotSdkConfiguration(
    license: Data,
    libraries: [DotPalmLibrary()]
)

try DotSdk.shared.initialize(configuration: dotSdkConfiguration)

After

Libraries are now configured via a single Libraries object, with explicit configuration for each DOT SDK library.

let dotPalmLibraryConfiguration = DotPalmLibraryConfiguration(
    modules: .init(detection: DotPalmDetectionModuleConfiguration())
)

let dotSdkConfiguration = DotSdk.Configuration(
    licenseBytes: license,
    libraries: .init(
        palm: dotPalmLibraryConfiguration
    )
)

try DotSdk.shared.initialize(configuration: dotSdkConfiguration)

UI Palm Auto Capture component

The PalmAutoCaptureViewController class’s API and configuration structure have changed. Existing configuration objects are not compatible with the new API and must be migrated to the new configuration model. Basic migration steps:

  • Update configuration.
  • Replace the method stopAsync(...) with the new method stop().
  • Remove the PalmAutoCaptureViewControllerDelegate.palmAutoCaptureViewController(:processed:) callback and implement palmAutoCaptureViewController(:uiStateUpdated:) instead. UiState is an enum, and its case UiState.Running replaces the data previously delivered via the onProcessed() callback.
  • Replace PalmAutoCaptureViewControllerDelegate.palmAutoCaptureViewController(:captured:) callback with palmAutoCaptureViewController(:finished:) callback.

Before

let configuration = try PalmAutoCaptureViewController.Configuration(
    sessionToken: sessionToken,
    qualityAttributeThresholds: PalmAutoCaptureViewController.Configuration.QualityAttributeThresholdPresets.standard.build(),
    minValidFramesInRowToStartCandidateSelection: 2,
    candidateSelectionDurationMillis: 2000,
    isDetectionLayerVisible: false,
    isTorchEnabled: false,
    isVideoCaptureEnabled: false,
    cameraFacing: .back,
    cameraPreviewScaleType: .fit,
    isCameraPreviewVisible: true,
    placeholderType: .left
)

let viewController = PalmAutoCaptureViewController(configuration: configuration)

extension SampleViewController: PalmAutoCaptureViewControllerDelegate {
    func palmAutoCaptureViewController(:processed:) {
        //...
    }

    func palmAutoCaptureViewController(:captured:) {
        //...
    }
}

After

let configuration = try PalmAutoCaptureViewController(
    configuration: .init(
        baseConfiguration: .init(
            common: .init(sessionToken: ""),
            camera: .init(
                facing: .back,
                previewScaleType: .fit,
                isTorchEnabled: false,
                isVideoCaptureEnabled: true,
                isPreviewVisible: true
            ),
            autoCapture: .init(minValidSamplesInRowToStartCandidateSelection: 2, candidateSelectionDurationMillis: 2000),
            qualityAttributeThresholds: PalmAutoCaptureQualityAttributeThresholds.Presets.standard.build()
        ),
        placeholder: .Visible(type: .left),
        isDetectionLayerVisible: false
    )
)

let viewController = PalmAutoCaptureViewController(configuration: configuration)

extension SampleViewController: PalmAutoCaptureViewControllerDelegate {
    func palmAutoCaptureViewController(:uiStateUpdated:) {
        //...
    }

    func palmAutoCaptureViewController(:finished:) {
        //...
    }
}

Image

Several changes were applied to image-related functionality.

  • BgraRawImage has been replaced by the Image class.
  • BgraRawImageFactory has been replaced by ImageFactory.

Before

var image: BgraRawImage = BgraRawImageFactory.create(cgImage:)
var image: BgraRawImage = BgraRawImageFactory.create(ciImage:ciContext:)

After

var image: Image = ImageFactory.createBgraRawImage(cgImage:)
var image: Image = ImageFactory.createBgraRawImage(ciImage:ciContext:)