Feedback and localization
The predefined UI can show geometry, pose, and V3 lighting guidance without enabling debug mode.
Show feedback in production
let style = MBUIOptions(
showProgressBar: true,
showFaceStatusLabel: true,
showCountdownTimerLabel: true
)
let options = MBCaptureSessionOptions(
isDebugging: false,
captureConstraints: .v3
)
isDebugging controls diagnostics. The MBUIOptions visibility properties control the user-facing interface.
Customize V3 messages
let faceTexts = MBFaceStatusTexts(
faceTooFarAway: "Move closer",
faceTooClose: "Move farther away",
facePoseInvalid: "Look straight at the camera",
checkingLighting: "Checking the light",
unevenLighting: "Use more even lighting",
insufficientLight: "Move to a brighter area"
)
let localizations = MBTextLocalizations(
countdownLabelText: "Hold still",
faceStatusTexts: faceTexts
)
let style = MBUIOptions(
showFaceStatusLabel: true,
showCountdownTimerLabel: true,
textLocalizations: localizations
)
Available face messages
| Property | Default text | Used for |
|---|---|---|
faceTooFarAway | Face too far away | Distance |
faceTooClose | Face too close | Distance |
faceTooFarUp | Face too far up | Position |
faceTooFarDown | Face too far down | Position |
faceTooFarLeft | Face too far left | Position |
faceTooFarRight | Face too far right | Position |
faceNotFound | Face not found | Detection |
tooManyFaces | Too many faces | Detection |
validFace | Valid face | Valid state |
facePoseInvalid | Look straight ahead | V2 and V3 pose |
checkingLighting | Checking lighting | V3 lighting pending |
unevenLighting | Find more even lighting | V3 uneven lighting |
insufficientLight | Find more light | V3 insufficient light |
Customize the camera permission alert
let permissionAlert = MBCameraPermissionAlert(
title: "Camera access required",
message: "Enable camera access in Settings to continue.",
settingText: "Open Settings",
cancelText: "Cancel"
)
let localizations = MBTextLocalizations(
cameraPermissionAlert: permissionAlert
)
Keep instructions short and actionable. When several checks fail, guide the user through geometry first and lighting second.