iOS 3.x.x UI only
OVERVIEW
TrustVision SDK is an iOS SDK for TrustVision Engine. It provides these features:
- ID and selfie matching.
- Liveness checking.
Specifications
- Xcode version 10.2+
- target iOS version 9+
- swift version: 5
Integration Steps
1. Adding the SDK to your project
Drag all file *. framework and *.bundle into project.

Note: Set up the optional status for TrustVisionNFC.xcframework
- Add key to info.plist:
<key>NSCameraUsageDescription</key>
<string>Open camera</string>
- Add dependencies
- Use CocoaPods, add these lines to podfile
pod 'TensorFlowLiteSwift', '~> 2.4.0'
pod 'PromiseKit', '~> 6.8'
pod 'CocoaLumberjack/Swift'
pod 'OpenSSL-Universal', '1.1.180' # if you are using module NFC
- Those lines are added at the end of podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
// If when compiling your project, "Undefined symbol" occurs, please add the module name which is having the error here
// add OpenSSL-Universal if you are using module NFC
if ['CocoaLumberjack', 'TensorFlowLiteC', 'TensorFlowLiteSwift', 'PromiseKit', 'lottie-ios', 'OpenSSL-Universal'].include? "#{target}"
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end
- If host app is using Objective-C, please follow these additional steps:
- add a empty swift file and create bridging file (to force project create key
SWIFT_VERSION) - add flag
-lc++and-ObjCinOther linker flags
- add a empty swift file and create bridging file (to force project create key
2. Start the SDK
The SDK provides some built in Activities example activity to capture id, selfie, liveness...
2.0. Initialize SDK
Initialize the sdk
TrustVisionSdk.shared.initialize(
clientSettingsJsonString: nil,
languageCode: "vi",
theme: TVTheme()
)
Options:
- clientSettingsJsonString:
String. The jsonConfigurationByServer is optional but recommended. It's the setting specialized for each client from TS server. It's the response json string get by API https://ekyc.trustingsocial.com/api-reference/customer-api/#get-client-settings. When it's null or unmatched with the expected type then the default setting in the SDK will be used. - languageCode:
String. Language code.vioren - theme:
TVTheme. UI customization theme.
2.1. Update and get sdk language
Allow user to change the sdk language after initialization
TrustVisionSdk.shared.changeLanguageCode(languageCode: String)
TrustVisionSdk.shared.getLanguageCode() -> String?
TrustVisionSdk.shared.getSupportedLanguageCodes() -> []
2.2. Capture the ID
The id capturing activity will show the camera to capture image, preview the image. To start the id capturing activity.
2.2.1. Set config parameters
let config = TVIdCardConfiguration(
cardType: selectedCardType,
cardSide: TVIdCardConfiguration.TVCardSide.front,
isSoundEnable: false,
isReadBothSide: false,
skipConfirmScreen: false,
isEnablePhotoGalleryPicker: false,
isEnableScanQr: true,
isEnableScanNfc: true
)
Options:
- cardType:
TVCardType. List of supported cards can be found bylet cardTypes: [TSCardType] = try TrustVisionSdk.getCardTypes() - cardSide:
TVCardSide. Card side to capture - isEnableSound:
Bool. Sound should be played or not - isReadBothSide:
Bool. If true then the sdk will capture both side if possible; otherwise, then the card side defined in cardSide will be used - skipConfirmScreen:
Bool. Skip id capturing confirmation screen nor not - isEnablePhotoGalleryPicker:
Bool. Allow user select id card image from phone gallery - isEnableScanQr :
Bool. Allow user select scan QR code of the id card or not - isEnableScanNfc :
Bool. Allow user select scan NFC chip of the id card or not
2.2.2. Start id capturing from configuration
let vc = TrustVisionSdk.shared.startIdCapturing(configuration: config, framesRecordedCallback: { batchId, frames, metadata, currentBatchIds in
}, readIdCardNumber: { (image) in
return ""
}, success: { (result) in
}, failure: { (error) in
}, cancellation: {
// sdk is canceled
})
where:
configuration:
TVIdCardConfigurationframesRecordedCallback:
- batchId:
String. new coming local batch id - frames:
Dictionary. batch frame to push - metadata:
Dictionary. batch metadata to push - currentBatchIds
[String]. For debugging only
This callback will be called each time there is a new frame batch coming. Client upload and get the batch id which is used for later id tampering api call.
- batchId:
success: method that will be called in case success. Parameters:
- result:
TVDetectionResult. Use the following fields:- frontIdImage
- backIdImage
- result:
failure:
FailureCallbackcancellation:
CancellationCallbackreadIdCardNumber: method that will be called in case of scan NFC to read SDK Id number from the image. The readIdCardNumber method has a parameter and return a string which is the id number of the card.
- image:
TVImageClass. image of back id card
- image:
2.2.3. Handle framesRecordedCallback
With each batch that returned by framesRecordedCallback callback,
call the below api to get server frame batch id, keep it corresponds to batchId returned in framesRecordedCallback - local id
https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-videoaudioframes
For example:
var frontCardFrameBatchIdsDictionary: [String: String] = [:]
var backCardFrameBatchIdsDictionary: [String: String] = [:]
. . .
framesRecordedCallback = { batchId, frames, metadata, currentBatchIds in
let batchDict = frames.merging(["metadata": metadata, "label": "The card type"]) { $1 }
let jsonToBeUploaded = try JSONSerialization.data(withJSONObject: batchDict, options: .prettyPrinted)
// upload frame batch to server using this api:
// https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-videoaudioframes
doYourUploadFrameBatchHere(withJSON: jsonToBeUploaded) { uploadingResult in
if cardSide == TVIdCardConfiguration.TVCardSide.front {
frontCardFrameBatchIdsDictionary.updateValue(uploadingResult.fileId, forKey: batchId)
}
else {
backCardFrameBatchIdsDictionary.updateValue(uploadingResult.fileId, forKey: batchId)
}
}
}
2.2.4. Handle ID capturing results
2.2.4.1. Remove redundant frame batch ids
For example:
// These lists contain all valid frame batch ids that responded by server
var validFrontCardServerFrameBatchIds: [String] = []
var validBackCardServerFrameBatchIds: [String] = []
private func removeRedudantFrameBatchIds(batchIdsDictionary: [String: String], validIdsFromSDK: [String]) -> [String] {
return batchIdsDictionary.compactMap({
if validIdsFromSDK.contains($0.key) {
return $0.value
}
else {
return nil
}
})
}
. . .
success = { result in
// result.frontCardFrameBatchIds && result.backCardFrameBatchIds is empty when Frame Recording feature is disabled by client settings.
// Wait until every Frame batch has been uploaded to server before calling this
if(everyFrameBatchUploadingCompleted) {
if (!result.frontCardFrameBatchIds.isEmpty) {
validFrontCardServerFrameBatchIds = removeRedudantFrameBatchIds(frontCardFrameBatchIdsDictionary, result.frontCardFrameBatchIds)
}
if (!result.backCardFrameBatchIds.isEmpty) {
validBackCardServerFrameBatchIds = removeRedudantFrameBatchIds(backCardFrameBatchIdsDictionary, result.backCardFrameBatchIds)
}
}
}
2.2.4.2. Get Image Ids to be used in a particular use case
Use this API https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-image The images should be uploaded as JPEG data with 100% quality. For example:
{
"file": "<dataToUpload>",
"label": "proper label, check the API document for detail"
}
2.2.4.3. Upload QR images
if result.frontIdQr.isRequired is true then result.frontIdQr.images array should be non-empty. Otherwise, clients should be warned to re-capture id card photos.
QR images will be uploaded with this api: https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-image
let dataToUpload = result.frontIdQr.images[i].imageByteArray
let qrId = yourMethodToUploadImage(dataToUpload)
- Fields:
- data:
dataToUpload - label:
result.frontIdQr.images[i].label - metadata:
result.frontIdQr.images[i].metadata
- data:
*The same logic will be applied to result.backIdQr
2.2.4.4. Call this api to check id tampering
Call this API https://ekyc.trustingsocial.com/api-reference/customer-api/#request-detect-id-card-tampering with params:
{
"image": {
"id": "<frontCardId>"
},
"image2": {
"id": "<backCardId>"
},
"qr1_images": [{
"id": "<qrId>"
}],
"card_type": "<result.cardType.id>",
"videos": [{
"id": "<validFrontCardServerFrameBatchIds[index]>"
},
{
"id": "<validFrontCardServerFrameBatchIds[index + 1]>"
},
...
{
"id": "<validBackCardServerFrameBatchIds[index]>"
},
{
"id": "<validBackCardServerFrameBatchIds[index + 1]>"
},
...
]
}
2.2.5. Scan NFC
After capture the back card, if the card has nfc chip, SDK will call readIdCardNumber method in background thread. With image that returned by readIdCardNumber,
call api to detect id number of the card then return id number to start flow scan NFC. If id number is null or empty, SDK skip flow scan NFC and continue
readIdCardNumber: { [weak self] (image) in
var idNumber = ""
// call api or do any thing to read and return id number
// TODO
return idNumber
}
2.3. Capture the selfie
The selfie capturing activity will show the camera to capture image, preview the image and verify active liveness in local. To start the selfie capturing activity.
2.3.1. Set config parameters
let config = TVSelfieConfiguration(
cameraOption: TVCameraOption.front,
isSoundEnable: true,
livenessMode: self.config.livenessMode,
skipConfirmScreen: false)
Options:
- cameraOption:
TVCameraOption. Set the camera mode - isSoundEnable:
Bool. Sound should be played or not - livenessMode:
TVLivenessMode. Set the liveness verification mode - skipConfirmScreen:
Bool. Skip selfie capturing confirmation screen or not
2.3.2. Start selfie capturing from configuration
let vc = TrustVisionSdk.shared.startSelfieCapturing(configuration: config,
framesRecordedCallback: { batchId, frames, metadata, currentBatchIds in
}, success: { (result) in
}, failure: { (error) in
}, cancellation: {
// sdk is canceled
})
where:
configuration:
TVSelfieConfigurationframesRecordedCallback:
- batchId:
String. new coming local batch id - frames:
Dictionary. batch frame to push - metadata:
Dictionary. batch metadata to push - currentBatchIds
[String]. For debugging only
This callback will be called each time there is a new frame batch coming. Client upload and get the batch id which is used for later selfie liveness api call.
- batchId:
success method that will be called in case success. Parameters:
- result :
TVDetectionResult. Use the following fields:- selfieImages
- result :
failure:
FailureCallbackcancellation:
CancellationCallback
2.3.3. Handle framesRecordedCallback callback
With each batch that returned by framesRecordedCallback callback,
call the below api to get server frame batch id, keep it corresponds to batchId returned in framesRecordedCallback - local id
https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-videoaudioframes
For example:
// this dictionary will be used for Liveness verification
var selfieFrameBatchIdsDictionary: [String: String] = [:]
. . .
framesRecordedCallback = { batchId, frames, metadata, currentBatchIds in
let batchDict = frames.merging(["metadata": metadata, "label": "video"]) { $1 }
let jsonToBeUploaded = try JSONSerialization.data(withJSONObject: batchDict, options: .prettyPrinted)
// upload frame batch to server using this api:
// https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-videoaudioframes
doYourUploadFrameBatchHere(withJSON: jsonToBeUploaded) { uploadingResult in
// Keep the id that generated by the SDK corresponding with the one responded from server
selfieFrameBatchIdsDictionary.updateValue(uploadingResult.fileId, forKey: batchId)
}
}
2.3.4. Handle selfie capturing results
2.3.4.1. Remove redundant frame batch ids
For example:
// These lists contain all valid frame batch ids that responded by server
var validServerFrameBatchIds: [String] = []
private func removeRedudantFrameBatchIds(batchIdsDictionary: [String: String], validIdsFromSDK: [String]) -> [String] {
return batchIdsDictionary.compactMap({
if validIdsFromSDK.contains($0.key) {
return $0.value
}
else {
return nil
}
})
}
. . .
success = { result in
// result.livenessFrameBatchIds is empty when Frame Recording feature is disabled by client settings.
// Wait until every Frame batch has been uploaded to server before calling this
if(everyFrameBatchUploadingCompleted) {
if (!result.livenessFrameBatchIds.isEmpty) {
validServerFrameBatchIds = removeRedudantFrameBatchIds(selfieFrameBatchIdsDictionary, result.livenessFrameBatchIds)
}
}
}
2.3.4.2 . Use this api to get image id:
https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-image The images should be uploaded as JPEG data with 100% quality. For example:
// with frontal images
let dataToUpload = result.selfieImages[i].frontalImage.imageByteArray
// with gesture images
let dataToUpload = result.selfieImages[i].gestureImage.imageByteArray
id of frontal image i = image id of result.selfieImages[i].frontalImage.rawImage
id of gesture image i = image id of result.selfieImages[i].gestureImage.rawImage
2.3.4.3. Use this api to get video id:
https://ekyc.trustingsocial.com/api-reference/customer-api/#upload-videoaudioframes
id of selfie video i = video id of result.livenessVideos[i]
2.3.4.4. Call this api to check liveness
API document: https://ekyc.trustingsocial.com/api-reference/customer-api/#verify-face-liveness
Call the above api with below parameters:
imagesfield
{
"images": [
{
"id": "<result.selfieImages[index].frontalImage.imageId>"
},
{
"id": "<result.selfieImages[index + 1].frontalImage.imageId>"
},
...
]
}
gesture_imagesfield
{
"gesture_images": [
{
"gesture": "<result.selfieImages[index].gestureType.description>",
"images": [{
"id": "<result.selfieImages[index].gestureImage.imageId>"
}]
},
{
"gesture": "<result.selfieImages[index + 1].gestureType.description>",
"images": [{
"id": "<result.selfieImages[index + 1].gestureImage.imageId>"
}]
},
...
]
}
videosfield
{
"videos": [
{
"id": "<validServerFrameBatchIds[index]>"
},
{
"id": "<validServerFrameBatchIds[index + 1]>"
},
...
]
}
metadatafield
{
"metadata": "<result.livenessMetadata>"
}
3. Additional built-in API
The SDK provides some built-in API for quick detection
3.0. Detect if device support NFC
Allow users to quick check if device support NFC so that they can determine for their next step
import TrustVisionNFC
...
isNfcSupport() -> Bool
API references
1. TVDetectionResult
| Properties | Type | description |
|---|---|---|
frontIdImage | TVImageClass | Image of id card's front side (use field rawImage) |
backIdImage | TVImageClass | Image of id card's back side (use field rawImage) |
frontIdQr | TVCardQr | Info of QR of id card's front side |
backIdQr | TVCardQr | Info of QR of id card's back side |
frontCardFrameBatchIds | [String] | List of front id frame batch IDs |
backCardFrameBatchIds | [String] | List of back id frame batch IDs |
nfcInfoResult | TVNfcInfoResult | Info in nfc chip. Use it to call api verify NFC |
| Properties | Type | description |
|---|---|---|
livenessResult | TVLivenessResult | Liveness check result |
selfieImages | [TVGestureImage] | Images of selfie |
livenessFrameBatchIds | [String] | List of selfie frame batch IDs |
livenessVideos | [Data] | List of video data during checking liveness |
livenessMetadata | [String: Any]? | Collected data during liveness checking process |
2. TVGestureImage
- gestureType: GestureType
- frontalImage: TVImageClass
- gestureImage: TVImageClass
3. TVGestureImage.GestureType
- up
- down
- left
- right
- frontal
4. TVCameraOption (Enum)
- TVCameraOption.front: Use front camera
- TVCameraOption.back: Use back camera
- TVCameraOption.both: The screen will have a button to switch between front & back camera
5. TVLivenessMode (Enum)
- TVLivenessMode.none: no liveness verification. Just capture the selfie and verify sanity.
- TVLivenessMode.passive: Use texture-based approach.
- TVLivenessMode.active: Use challenge-response approach. User needs to follow and finish all steps when capturing selfie like turn left, right, up, smile, open mouth...
6. TVLivenessResult
- isLive: selfie is live or not
7. TVCardQr
- isRequired: This side of card contains QR or not
- images: [TVImageClass]. Array of QR images
8. FailureCallback (Callback)
Will be called in case failed. Parameters:
- error:
TVError.- errorCode: the specific error code.
- description: the human-readable error description can be show to end user
9. CancellationCallback (Callback)
Will be called in case the sdk is cancelled. No parameters
10. TVNfcInfoResult
| Properties | Type | Description |
|---|---|---|
com | String | |
sod | String | |
dg1 | String | |
dg2 | String | |
dg13 | String | |
dg14 | String | |
dg15 | String | |
getCloneStatus() | TVNfcVerificationResultStatus |
11. TVNfcVerificationResultStatus
| Properties | Type | Description |
|---|---|---|
error | TVError | |
verdict | TVNfcVerdict | TVNfcVerdict.notChecked TVNfcVerdict.alert TVNfcVerdict.good TVNfcVerdict.error |
UI Customization
This document introduces how to enable the ability to customize UI components of TrustingVision SDK.
Default UI prototypes
Check out the default UI of TrustingVision SDK. We provide you the ability to change and modify many UI components: background colors, font interfaces, font sizes, icons, buttons.





Before initialize the SDK
Initialize and change properties of TVTheme class. If any of which is not set, it will get default value.
TVTheme let you custom and override attributes, which includes:
| Properties/Functions | Type | Description |
|---|---|---|
idCapturingTheme | TVIdCapturingTheme | Attributes that change the UI of ID Card Detection screen. |
idConfirmationTheme | TVIdConfirmationTheme | Attributes that change the UI of ID Confirmation screen. |
selfieCapturingTheme | TVSelfieCapturingTheme | Attributes that change the UI of Selfie Capturing screen. |
selfieConfirmationTheme | TVSelfieConfirmationTheme | Attributes that change the UI of Selfie Confirmation screen. |
qrGuidelinePopupTheme | TVQrPopupTheme | Modifying UI of QR guildline popup. |
qrRetryPopupTheme | TVQrPopupTheme | Modifying UI of QR retry popup. |
clone() | () -> TVTheme | A function that returns a deep copy of TVTheme's instance itself. |
Common UI components
Object TVThemeDefaultValues helps you to quickly change some common UI components that will be used across the whole SDK.
In case a specific Screen's theme is set, it will override TVThemeDefaultValues's properties.
| Properties | Type | Description |
|---|---|---|
normalLabelTheme | TVLabelTheme | Normal text of SDK. |
titleLabelTheme | TVLabelTheme | The title of any screen (located on the top-most, centered of screen). |
errorLabelTheme | TVLabelTheme | This text is shown as if any user misconduction or system failure occurred during the detection process. |
instructionLabelTheme | TVLabelTheme | Instruction text. |
timeoutLabelTheme | TVLabelTheme | The count down text. |
The object TVLabelTheme can be described in this table below:
| Properties/Functions | Type | Label's |
|---|---|---|
font | UIFont | font interface, weight, size |
textColor | UIColor | text color |
textGravity | NSTextAlignment | text alignment of its frame |
backgroundColors | Array of UIColor | background colors. If total element of this array is 1, the background color is solid. |
isBackgroundGradientHorizontal | Bool | background gradient direction |
cornerRadius | CGFloat | rounded corner |
isHidden | Bool | hide the label |
borderWidth | CGFloat | border width |
borderColor | UIColor | border color |
clone() | () -> TVLabelTheme | A function that returns a deep copy of TVLabelTheme's instance itself. |
Here is snipped code example:
//Change default value for all screen
TVThemeDefaultValue.titleLabelTheme = TVLabelTheme(
font: .systemFont(ofSize: 16.0, weight: .regular),
textColor: .yellow, textGravity: .center,
backgroundColors: [.cyan],
isBackgroundGradientHorizontal: false,
cornerRadius: 8.0, isHidden: false,
borderWidth: 4.0,
borderColor: .brown)
TVThemeDefaultValue.errorLabelTheme = TVLabelTheme(
font: .systemFont(ofSize: 14.0, weight: .bold),
textColor: .red,
textGravity: .center,
backgroundColors: [.orange],
isBackgroundGradientHorizontal: false,
cornerRadius: 8.0,
isHidden: false,
borderWidth: 0.0,
borderColor: .brown)
TVThemeDefaultValue.instructionLabelTheme = TVLabelTheme(
font: .systemFont(ofSize: 14.0, weight: .regular),
textColor: .blue,
textGravity: .center,
backgroundColors: [.white],
isBackgroundGradientHorizontal: false,
cornerRadius: 8.0,
isHidden: false,
borderWidth: 4.0,
borderColor: .brown)
TVThemeDefaultValue.timeoutLabelTheme = TVLabelTheme(
font: .systemFont(ofSize: 14.0, weight: .regular),
textColor: .red,
textGravity: .center,
backgroundColors: [],
isBackgroundGradientHorizontal: false,
cornerRadius: 0,
isHidden: true,
borderWidth: 0,
borderColor: .brown)
// Init theme
theme = TVTheme()
// Specific change for ID Capturing Screen
theme.idCapturingTheme.instructionLabelTheme = TVLabelTheme(font: .systemFont(ofSize: 14.0, weight: .bold), textColor: .yellow, textGravity: .center, backgroundColors: [.darkGray], isBackgroundGradientHorizontal: false, cornerRadius: 8.0, isHidden: false)
theme.idCapturingTheme.showTrademark = false
theme.idCapturingTheme.backgroundColor = .lightGray
theme.idCapturingTheme.qrMaskViewSuccessImage = UIImage(named: "QR normal mask view")!
theme.idCapturingTheme.qrMaskViewErrorImage = UIImage(named: "QR normal mask view2")!
theme.idCapturingTheme.qrMaskViewNeutralImage = UIImage(named: "QR normal mask view1")!
theme.idCapturingTheme.maskViewErrorImage = UIImage(named: "id_card_error_bg")!
theme.idCapturingTheme.maskViewNeutralImage = UIImage(named: "id_card_bg_front")!
theme.idCapturingTheme.maskViewSuccessImage = UIImage(named: "id_card_success_bg")!
// Specific change for ID Confirmation Screen
theme.idConfirmationTheme.icQrResultErrorImage = UIImage(named: "icon_qr_describe_1")!
theme.idConfirmationTheme.icQrResultSuccessImage = UIImage(named: "icon_qr_describe_2")!
theme.idConfirmationTheme.backgroundColor = .yellow
// Specific change for Selfie Capturing Screen
theme.selfieCapturingTheme.backgroundColor = .lightText
theme.selfieCapturingTheme.instructionLabelTheme = TVLabelTheme(font: .systemFont(ofSize: 14.0, weight: .bold), textColor: .yellow, textGravity: .center, backgroundColors: [.darkGray], isBackgroundGradientHorizontal: false, cornerRadius: 8.0, isHidden: false)
theme.selfieCapturingTheme.maskViewSuccessImage = UIImage(named: "selfie_bg_no_sticks_focus success")!
theme.selfieCapturingTheme.maskViewNeutralImage = UIImage(named: "selfie_bg_no_sticks_focus normal")!
theme.selfieCapturingTheme.maskViewErrorImage = UIImage(named: "selfie_bg_no_sticks_focus error")!
theme.selfieCapturingTheme.progressTheme.progressColor = .clear
theme.selfieCapturingTheme.gestureTheme.turnUpActiveImage = UIImage(named: "liveness_up")!
theme.selfieCapturingTheme.gestureTheme.turnDownActiveImage = UIImage(named: "liveness_down")!
theme.selfieCapturingTheme.gestureTheme.turnLeftActiveImage = UIImage(named: "liveness_left")!
theme.selfieCapturingTheme.gestureTheme.turnRightActiveImage = UIImage(named: "liveness_right")!
theme.selfieCapturingTheme.gestureTheme.lookStraightActiveImage = UIImage(named: "liveness_opposite")!
ID Card Detection: UI customization

Class TVIdCapturingTheme
If a property is not set, default value will be used.
| Properties | Type | Description |
|---|---|---|
titleLabelTheme | TVLabelTheme | See Common UI components section. |
instructionLabelTheme | TVLabelTheme | |
errorLabelTheme | TVLabelTheme | |
timeoutLabelTheme | TVLabelTheme | |
normalLabelTheme | TVLabelTheme | |
qrInstructionLabelTheme | TVLabelTheme | The instruction text that show during QR scanning process. |
closeButtonLocation | enumTVButtonLocation | The position of close button to device orientation: .TOP_LEFT: to the left of the title .TOP_RIGHT: to the right of the title .NONE: hide the button |
showTrademark | Boolean | Show the trademark text or not. |
backgroundColor | UIColor | Sets the background color of view. Default value is black with 60% opacity. |
captureButtonImage | UIImage | The image of the capture button. |
captureButtonDisableImage | UIImage | The image of the disabled capture button. |
closeButtonImage | UIImage | The image of the close view button. |
maskViewNeutralImage | UIImage | The mask image of camera view when start the ID Capture flow. |
maskViewSuccessImage | UIImage | The mask image of camera view when detected a valid ID card. |
maskViewErrorImage | UIImage | The mask image of camera view when cannot detect any ID card. |
qrInstructionBackgroundImage | UIImage | The image behind the QR instruction text. |
qrMaskViewNeutralImage | UIImage | The mask image of camera view when start QR detection or not detected any QR code. |
qrMaskViewSuccessImage | UIImage | The mask image of camera view when detected a valid QR code. |
qrMaskViewErrorImage | UIImage | The mask image of camera view when detected an invalid QR code. |
loadingImage | UIImage | Loading indicator in image. |
clone() | () -> TVIdCapturingTheme | A function that returns a deep copy of TVIdCapturingTheme's instance itself. |
ID Card Confirmation: UI customization

Class TVIdConfirmationTheme
If a property is not set, default value will be used.
| Properties | Type | Description |
|---|---|---|
titleLabelTheme | TVLabelTheme | See Common UI components section. |
errorLabelTheme | TVLabelTheme | |
normalLabelTheme | TVLabelTheme | |
closeButtonLocation | enumTVButtonLocation | The position of close button to device orientation: .TOP_LEFT: to the left of the title .TOP_RIGHT: to the right of the title .NONE: hide the button |
showTrademark | Boolean | Show the trademark text or not. |
backgroundColor | UIColor | Sets the background color of view. Default value is black with 60% opacity. |
closeButtonImage | UIImage | The image of the close view button. |
confirmButtonImage | UIImage | The image of the "Look good" button. |
retryButtonImage | UIImage | The image of the "Try again" button. |
icQrResultSuccessImage | UIImage | Icon before text that scanned QR successfully. |
icQrResultErrorImage | UIImage | Icon before text that scanned QR failed. |
maskViewImage | UIImage | The mask image of camera view showing captured image. |
loadingImage | UIImage | Loading indicator in image. |
clone() | () -> TVIdConfirmationTheme | A function that returns a deep copy of TVIdConfirmationTheme's instance itself. |
Selfie Capturing: UI customization

Class TVSelfieCapturingTheme
If a property is not set, default value will be used.
| Properties | Type | Description |
|---|---|---|
titleLabelTheme | TVLabelTheme | See Common UI components section. |
instructionLabelTheme | TVLabelTheme | |
errorLabelTheme | TVLabelTheme | |
timeoutLabelTheme | TVLabelTheme | |
normalLabelTheme | TVLabelTheme | |
closeButtonLocation | enumTVButtonLocation | The position of close button to device orientation: .TOP_LEFT: to the left of the title .TOP_RIGHT: to the right of the title .NONE: hide the button |
showTrademark | Boolean | Show the trademark text or not. |
backgroundColor | UIColor | Sets the background color of view. Default value is black with 60% opacity. |
captureButtonImage | UIImage | The image of the capture button. |
captureButtonDisableImage | UIImage | The image of the disabled capture button. |
closeButtonImage | UIImage | The image of the close view button. |
switchCameraSideImage | UIImage | The image of switch camera button. |
maskViewNeutralImage | UIImage | The mask image of camera view when start the selfie flow. |
maskViewSuccessImage | UIImage | The mask image of camera view when detected a valid face. |
maskViewErrorImage | UIImage | The mask image of camera view when cannot detect any valid face. |
progressTheme.isHidden | Bool | Hide the current 4 steps view. |
progressTheme.backgroundColor | UIColor | Background color of the circle progress theme. |
progressTheme.progressColor | UIColor | Background color of the progress steps. |
gestureTheme.isHidden | Bool | Whether of not should hide selfie steps' group view. |
gestureTheme.turnLeftActiveImage | UIImage | Image for turn left step gesture when active. |
gestureTheme.turnRightActiveImage | UIImage | Image for turn right step gesture when active. |
gestureTheme.turnUpActiveImage | UIImage | Image for turn up step gesture when active. |
gestureTheme.turnDownActiveImage | UIImage | Image for turn down step gesture when active. |
gestureTheme.lookStraightActiveImage | UIImage | Image for look straight step gesture when active. |
gestureTheme.turnLeftInactiveImage | UIImage | Image for turn left step gesture when inactive. |
gestureTheme.turnRightInactiveImage | UIImage | Image for turn right step gesture when inactive. |
gestureTheme.turnUpInactiveImage | UIImage | Image for turn up step gesture when inactive. |
gestureTheme.turnDownInactiveImage | UIImage | Image for turn down step gesture when inactive. |
gestureTheme.lookStraightInactiveImage | UIImage | Image for look straight step gesture when inactive. |
gestureTheme.finishedGestureBackgroundImage | UIImage | Background for every step that completed. |
gestureTheme.currentStepFocusImage | UIImage | Image overlay for current step indicator. |
maskViewErrorImage | UIImage | The mask image of camera view when cannot detect any valid face. |
maskViewErrorImage | UIImage | The mask image of camera view when cannot detect any valid face. |
loadingImage | UIImage | Loading indicator in image. |
clone() | () -> TVSelfieCapturingTheme | A function that returns a deep copy of TVSelfieCapturingTheme's instance itself. |