Customizing Document Detector
This guide covers version 7.0.0 and above. For versions below 7.0.0, please see the legacy documentation.
Overview
Customization interface
1. Minimal open — default UI, RG front + back
import UIKit
import CafSDK
final class DocumentFlowViewController: UIViewController {
func startDocumentDetector() {
CerttaDocumentDetector.shared.delegate = self
let flow: [CafDocumentDetectorStep] = [
CafDocumentDetectorStep(stepType: .rgFront),
CafDocumentDetectorStep(stepType: .rgBack)
]
let configuration = CerttaDocumentDetectorConfiguration(
flow: flow,
ui: CerttaDocumentDetectorUIConfiguration(),
enableMultiLanguage: true
)
CerttaDocumentDetector.shared.open(from: self, configuration: configuration)
}
}
extension DocumentFlowViewController: CerttaDocumentDetectorDelegate {
func didFinish(result: String) {
// Send `result` to your backend (signed payload).
}
func didFinishWith(_ error: CerttaError) {
// Map `error` / `error.message` to UI (see README).
}
}2. Structured UI — selection, instructions, capture chrome, upload
3. Per-step copy and illustration
4. String customizations (CafDDCustomization)
5. Legacy initializer — CafDocumentDetectorLayout + CafInstructionsConfiguration
6. Bridge from full CafDocumentDetectorConfig
7. Full control — CafSDKProvider.Builder + proxy / passport / delays
8. Bridge legacy CafDocumentDetectorLayout + CafInstructionsConfiguration into CerttaDocumentDetectorUIConfiguration
9. Session colors before opening DD
10. Optional: warm-up with loadSession
CerttaDocumentDetectorUIConfiguration
Property
Type
What it does
Default (typical)
CafDocumentDetectorDocumentSelectionScreen
Property
Type
What it does
CafDocumentDetectorInstructionsScreen
Property
Type
What it does
Default
CafDocumentDetectorCaptureScreen
Property
Type
What it does
Default
CerttaDocumentDetectorCustomization
Property
Type
What it does
CerttaDocumentDetectorConfiguration (parameters)
Recommended: init(flow:ui:enableMultiLanguage:)
Input
Role
Legacy: init(flow:layout:uploadSettings:instructionsConfig:requestTimeout:showPreCapturePopup:showPreview:ddCustomizations:enableMultiLanguage:selectDocumentConfig:maxRetryAttempts:)
Parameter
Default
What it does
init(from: CafDocumentDetectorConfig)
CafDocumentDetectorConfig (full model)
Property
Type
What it does
CafDocumentDetectorStep & CafDocumentStepType
CafDocumentStepType
Case
Meaning
CafDocumentDetectorStep fields
Property
Type
What it does
CafDocumentDetectorLayout & feedback colors
CafDocumentDetectorLayout
Property / API
What it does
CafDocumentFeedbackColors
Property
Default
What it does
CafInstructionsConfiguration
Property
Used for DD (capture path)
CafSelectDocumentConfig & CafDocumentTypeKey
Property
What it does
CafUploadSettings & CafFileFormatWrapper
CafUploadSettings
Property
Default
What it does
CafFileFormatWrapper
CafProxySettings
Property
What it does
CafDDCustomization types
CafDDUploadCustomization
CafPreviewCustomization
CafUploadMessagesCustomization
CafFailedPhotoCustomization
Passport allowlist (CafCountryCode)
Global colors
Last updated

