Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/signing-sdk/face-auth-ios/llms.txt

Use this file to discover all available pages before exploring further.

TadSigningViewController is a UIViewController subclass you present modally to run either passkey registration or authentication. It handles the full flow — face liveness check, WebAuthn credential creation or assertion, and JWT signing — then calls your completion handler on the main thread when the operation completes or fails.

Class declaration

class TadSigningViewController: UIViewController

Initializer

TadSigningViewController(
    config: TadSigningConfig,
    bankId: String,
    dto: [String: String],
    mode: TadSigningMode,
    completion: (TadSigningResult) -> Void
)

Parameters

config
TadSigningConfig
required
SDK configuration object containing the API endpoint, ES512 public key, WebAuthn relying party ID, and service name. See TadSigningConfig.
bankId
String
required
Unique identifier for the bank user. This value ties the WebAuthn passkey to a specific user account and must be consistent across registration and subsequent sign operations.
dto
[String: String]
Additional data to pass to the backend. Pass an empty dictionary [:] when no extra data is needed. A common use case is forwarding a one-time password: ["otp": "12345"].
mode
TadSigningMode
required
Controls whether the controller performs passkey creation (.register) or authentication and JWT signing (.sign). See TadSigningMode.
completion
(TadSigningResult) -> Void
required
Called on the main thread when the operation finishes. Receives a TadSigningResult value of either .success or .failure.

Presenting the controller

Always present TadSigningViewController modally using present(_:animated:). Do not push it onto a navigation stack.
vc.present(signingVC, animated: true)

Threading

The completion closure is always called on the main thread, so you can safely update UI directly inside it without dispatching to DispatchQueue.main.

Usage example

The following example is taken from the demo app’s ContentView.swift. It builds the dto from an optional OTP field, creates the view controller, and presents it from the topmost UIViewController in the current scene.
import SwiftUI
import TadSigningSDK

private func present(mode: TadSigningMode) {
    guard let vc = topViewController() else { return }
    isLoading = true

    let dto = otp.isEmpty ? [:] : ["otp": otp]

    let signingVC = TadSigningViewController(
        config: SDKConfig.shared,
        bankId: bankId,
        dto:    dto,
        mode:   mode
    ) { signingResult in
        isLoading = false
        switch signingResult {
        case .success(let jwt, let requestId):
            resultColor = .green
            result = mode == .register
                ? "Registered\nrequestId: \(requestId)"
                : "Signed\nrequestId: \(requestId)\n\nJWT:\n\(jwt)"
        case .failure(let code, let message):
            resultColor = .red
            result = "\(code.rawValue)\n\(message)"
        }
    }

    vc.present(signingVC, animated: true)
}

Build docs developers (and LLMs) love