ActiveFaceCaptureView

struct ActiveFaceCaptureView : View

Active Face Capture view This view is responsible for capturing the user’s face and guiding them through the process. It includes animations, instructions, and error handling.

  • The view starts by setting up the initial camera configuration and preparing for face scanning.
  • It displays a camera view with a red circle indicating the user’s face position.
  • It also includes an arc animation to guide the user on where to position their face.
  • Instructions are displayed based on the current state of the face capture process.
  • The view handles different types of errors that may occur during face capture, such as timeout, motion too fast, or liveness failure.
  • It includes functions to show dialogs with retry options or single button confirmation based on the error type.
  • The view also decrypts QR data after successful face capture and displays person details if decryption is successful. Overall, this view provides a seamless experience for users to capture their faces accurately and handle any errors that may occur during the process.
  • Unique identifier for animation

    Declaration

    Swift

    @State
    private var animationID: UUID { get nonmutating set }
  • Flag to indicate if animation is currently playing

    Declaration

    Swift

    @State
    private var animationPlaying: Bool { get nonmutating set }
  • Flag to show/hide an alert

    Declaration

    Swift

    @State
    private var showAlert: Bool { get nonmutating set }
  • Number of previously completed states

    Declaration

    Swift

    @State
    private var previousNumCompletedStates: UInt8? { get nonmutating set }
  • Factory object for face capture

    Declaration

    Swift

    @StateObject
    private var faceCaptureFactory: ActiveFaceCaptureFactory { get }
  • Expected user action for face capture

    Declaration

    Swift

    @State
    var expectedUserAction: ActiveFaceCaptureStateName? { get nonmutating set }
  • Target action score for face capture

    Declaration

    Swift

    @State
    var targetActionScore: Float? { get nonmutating set }
  • Instructions for face capture

    Declaration

    Swift

    @State
    var instructions: String { get nonmutating set }
  • Total number of states for face capture

    Declaration

    Swift

    @State
    var numStates: UInt8? { get nonmutating set }
  • Number of completed states for face capture

    Declaration

    Swift

    @State
    var numCompletedStates: UInt8? { get nonmutating set }
  • Flag to show/hide user guide face animation

    Declaration

    Swift

    @State
    var showUserGuideFaceAnimation: Bool { get nonmutating set }
  • Flag to show/hide arc animation

    Declaration

    Swift

    @State
    var showArc: Bool { get nonmutating set }
  • Angle of the arc animation

    Declaration

    Swift

    @State
    var arcAngle: Double { get nonmutating set }
  • Animated angle of the arc animation

    Declaration

    Swift

    @State
    var animatedArcAngle: Double { get nonmutating set }
  • Error type for face capture

    Declaration

    Swift

    @State
    var error: SDKErrors { get nonmutating set }
  • Flag to show/hide error message

    Declaration

    Swift

    @State
    var showError: Bool { get nonmutating set }
  • Current animation file name

    Declaration

    Swift

    @State
    var getCurrentAnimationFile: String { get nonmutating set }
  • Binding for path

    Declaration

    Swift

    @Binding
    var path: Bool { get nonmutating set }
  • Diameter of the circle

    Declaration

    Swift

    let circleDiameter: CGFloat
  • Diameter of the camera view

    Declaration

    Swift

    let cameraDiameter: CGFloat
  • Size of the arc

    Declaration

    Swift

    let arcSize: CGFloat
  • Opacity for the arc

    Declaration

    Swift

    let arcOpacity: Double
  • Width of the stroke

    Declaration

    Swift

    let width: Double
  • Offset angle for the stroke

    Declaration

    Swift

    let offsetAngle: Double
  • Password for face capture

    Declaration

    Swift

    var password: String
  • Hex color for the circle

    Declaration

    Swift

    @State
    var circleHexColor: UInt { get nonmutating set }
  • Flag to indicate if data is loading

    Declaration

    Swift

    @State
    var isLoading: Bool { get nonmutating set }
  • Metadata for face capture

    Declaration

    Swift

    @State
    var metaData: [String : String] { get nonmutating set }
  • Face bytes for face capture

    Declaration

    Swift

    @State
    var faceBytes: Data { get nonmutating set }
  • Flag to indicate if person detail view is active

    Declaration

    Swift

    @State
    var isPersonDetial: Bool { get nonmutating set }
  • Flag to indicate if generate QR view is active

    Declaration

    Swift

    @State
    var isGenerateQr: Bool { get nonmutating set }
  • Binding for QR bytes

    Declaration

    Swift

    @Binding
    var qrBytes: [UInt8] { get nonmutating set }
  • Type of view

    Declaration

    Swift

    var typeView: TypeView?
  • Presentation mode environment variable

    Declaration

    Swift

    @Environment
    var presentationMode: Binding<PresentationMode> { get }
  • Dismiss environment variable

    Declaration

    Swift

    @Environment
    var dismiss: DismissAction { get }
  • This is the body of the ActiveFaceCaptureView

    Declaration

    Swift

    var body: some View { get }
  • Get the oval width

    See more

    Declaration

    Swift

    struct BackToMainSectionFromData : View

    Return Value

    The width of the oval

  • Check camera permission and show the alert if permission is not granted

    Declaration

    Swift

    func checkCameraPermission()
  • Set up initial configurations for face capture

    Declaration

    Swift

    func setUpInitial()
  • Update the instructions for face capture

    Declaration

    Swift

    func updateInstructions(model: ActiveFaceCaptureModel)

    Parameters

    model

    The ActiveFaceCaptureModel containing the updated instructions.

  • Update the circle color for face capture

    Declaration

    Swift

    func updateCircleColor(model: ActiveFaceCaptureModel)

    Parameters

    model

    The ActiveFaceCaptureModel containing the updated circle color.

  • Update the number of instructions for face capture

    Declaration

    Swift

    func updateNumberOfInstruction(model: ActiveFaceCaptureModel)

    Parameters

    model

    The ActiveFaceCaptureModel containing the updated number of instructions.

  • Handles the completion of the face capture process

    Declaration

    Swift

    func sessionCompleted()
  • Update the directions for face capture

    Declaration

    Swift

    func updateDirections(model: ActiveFaceCaptureModel)

    Parameters

    model

    The ActiveFaceCaptureModel containing the updated directions.

  • Update the animation for face capture

    Declaration

    Swift

    func updateAnimation(model: ActiveFaceCaptureModel)

    Parameters

    model

    The ActiveFaceCaptureModel containing the updated animation.

  • Show the error view for face capture

    Declaration

    Swift

    func showError(model: ActiveFaceCaptureModel)

    Parameters

    model

    The ActiveFaceCaptureModel containing the error information.

  • Show the dialog with a single button for the given error

    Declaration

    Swift

    func showDialogWithSingleButton(_ error: SDKErrors) -> some View

    Parameters

    error

    The SDKErrors representing the error type.

    Return Value

    The DialogViewWithSingleButton view.

  • Show the timeout error dialog for face capture

    Declaration

    Swift

    func showActiveTimeOutError(_ error: SDKErrors) -> some View

    Parameters

    error

    The SDKErrors representing the error type.

    Return Value

    The ActiveCaptureErrorDialog view.

  • Show active motion to fast error dialog

    • error: The error object

    Declaration

    Swift

    func showActiveMotionToFast(_ error: SDKErrors) -> some View

    Return Value

    A view representing the active motion to fast error dialog

  • Show confirmation dialog with retry

    • error: The error object

    Declaration

    Swift

    private func confirmationDialogWithRetry(_ error: SDKErrors) -> some View

    Return Value

    A view representing the confirmation dialog with retry

  • Show liveness error dialog

    • error: The error object

    Declaration

    Swift

    func showFaceCaptureLivenessError(_ error: SDKErrors) -> some View

    Return Value

    A view representing the liveness error dialog

  • Show no face detected error dialog

    • error: The error object

    Declaration

    Swift

    func showFaceCaptureNoFaceDetected(_ error: SDKErrors) -> some View

    Return Value

    A view representing the liveness error dialog

  • Show face capture error dialog

    • error: The error object

    Declaration

    Swift

    func showFaceCapturError(_ error: SDKErrors) -> some View

    Return Value

    A view representing the liveness error dialog

  • Get the opacity for the arc

    Declaration

    Swift

    func getArcOpacity() -> Double

    Return Value

    The opacity value for the arc

  • Start indication

    • model: The active face capture model

    Declaration

    Swift

    func startIndication(model: ActiveFaceCaptureModel) -> Bool

    Return Value

    A boolean value indicating whether to start indication or not

  • Show face capture multiple face error dialog

    • error: The error object

    Declaration

    Swift

    func showFaceCapturMultipleFaceError(_ error: SDKErrors) -> some View

    Return Value

    A view representing the liveness error dialog

  • Decrypt SensePrint QR

    This function decrypts the SensePrint QR

    • password: The password used for decryption

    Declaration

    Swift

    func decryptSensePrintQR()
  • Get the error view and show different dialog according to the error type

    Declaration

    Swift

    func getErrorView() -> some View

    Return Value

    A view representing the error view