Настройка iOS SDK

Настройка интерфейса

Чтобы настроить интерфейс Oz Liveness, воспользуйтесь OZCustomization. Полный список полей находится здесь.

circle-exclamation
// параметры настройки верхней панели
let toolbarCustomization = ToolbarCustomization(
   closeButtonIcon: UIImage(named: "example"),
   closeButtonColor: .black.withAlphaComponent(0.8),
   titleText: "",
   titleFont: .systemFont(ofSize: 18, weight: .regular),
   titleColor: .gray,
   backgroundColor: .lightGray)

// параметры настройки текста подсказки
let centerHintCustomization = CenterHintCustomization(textColor: .white,
   textFont: .systemFont(ofSize: 22, weight: .regular),
   verticalPosition: 42,
   backgroundColor: UIColor.init(hexRGBA: "1C1C1E8F")!,
   hideTextBackground: false,
   backgroundCornerRadius: 14)
   
// параметры настройки анимации подсказки
let hintAnimationCustomization = HintAnimationCustomization(
   hideAnimation: false,
   animationIconSize: 80,
   toFrameGradientColor: UIColor.red)

// параметры настройки рамки вокруг лица
let faceFrameCustomization = FaceFrameCustomization(
   strokeWidth: 4,
   strokeFaceAlignedColor: .green,
   strokeFaceNotAlignedColor: .red,
   geometryType = .rect(cornerRadius: 10),
   strokePadding: 3)

// параметры настройки текста версии SDK
let versionCustomization = VersionLabelCustomization(
   textFont: .systemFont(ofSize: 13, weight: .regular),
   textColor: .gray
)

// параметры настройки фона за рамкой
let backgroundCustomization = BackgroundCustomization(
   backgroundColor: .lightGray
)

// параметры настройки защиты от мошенников
let antiscamCustomization: AntiscamCustomization = AntiscamCustomization(
   customizationEnableAntiscam: false,
   customizationAntiscamTextMessage: "Face recognition",
   customizationAntiscamTextFont: UIFont.systemFont(ofSize: 15, weight: .semibold),
   customizationAntiscamTextColor: UIColor.black,
   customizationAntiscamBackgroundColor: UIColor.init(hexRGBA: "F2F2F7FF")!,
   customizationAntiscamCornerRadius: 18,
   customizationAntiscamFlashColor: UIColor.init(hexRGBA: "FF453AFF")!)

// параметры настройки логотипа,
// если лицензия предусматривает возможность его изменения
let logoCustomization = LogoCustomization(
   image: UIImage(), 
   size: CGSize(width: 100, height: 100), 
   verticalPosition: 100, 
   horizontalPosition: 50)

OZSDK.customization = Customization(toolbarCustomization: toolbarCustomization,
   antiscamCustomization: antiscamCustomization,
   centerHintCustomization: centerHintCustomization,
   hintAnimationCustomization: hintAnimationCustomization,
   faceFrameCustomization: faceFrameCustomization,
   versionCustomization: vesrionCustomization,
   backgroundCustomization: backgroundCustomization,
   logoCustomization: logoCustomization)

Last updated

Was this helpful?