Structures

The following structures are available globally.

  • A type-erased wrapper for any Codable value.

    This wrapper allows heterogeneous data types to be stored in the same dictionary while maintaining Codable compliance for JSON serialization.

    Supported Types

    • Primitives: Bool, Int, Double, String
    • Collections: Arrays and Dictionaries (recursively)
    • Null values: NSNull representation

    Usage

    let anyValue = AnyValue("Hello World")
    let originalValue = anyValue.value as? String
    
    See more

    Declaration

    Swift

    public struct AnyValue : Codable, @unchecked Sendable
  • A dynamic coding key implementation that allows encoding and decoding of arbitrary JSON keys.

    This structure provides flexibility when working with JSON data that contains dynamic or unknown keys at compile time, supporting both string and integer-based keys.

    See more

    Declaration

    Swift

    public struct JSONCodingKeys : CodingKey
  • A utility structure providing helper methods for JSON serialization and manipulation.

    JSONUtils offers static methods for common JSON operations, including converting objects to JSON strings with configurable formatting options.

    See more

    Declaration

    Swift

    public struct JSONUtils
  • Describes a single step in a migration pipeline.

    MigrationStep is a lightweight value type that provides identification and display metadata for a migration step. Each migration module defines its own steps as static properties via extensions.

    The id property provides a stable, non-localizable identifier for programmatic checks (e.g., UI state comparisons), while description is a human-readable, display-only field that can be freely translated.

    Defining Custom Steps

    Migration modules extend MigrationStep with their own step constants:

    extension MigrationStep {
        static let importLegacyData   = MigrationStep(id: "importLegacyData", description: "Import legacy data")
        static let migrateCredentials = MigrationStep(id: "migrateCredentials", description: "Migrate credentials")
        static let cleanup            = MigrationStep(id: "cleanup", description: "Cleanup legacy data")
    }
    

    Usage

    Steps are passed as associated values in MigrationProgress events:

    case .inProgress(let step, let current, let total):
        print("Step \(current)/\(total): \(step.description)")
    
    See more

    Declaration

    Swift

    public struct MigrationStep : Sendable, Identifiable, Equatable, Hashable, CustomStringConvertible
  • Policy that checks if biometric authentication is available on the device.

    This policy evaluates whether the device has biometric capabilities and if they are properly configured for authentication.

    JSON format: {“biometricAvailable”: {}}

    See more

    Declaration

    Swift

    public struct BiometricAvailablePolicy : MfaPolicy, Sendable
  • Represents the result of policy evaluation for a credential. Encapsulates both the compliance status and identifies which policy (if any) caused non-compliance.

    See more

    Declaration

    Swift

    public struct MfaPolicyResult : Sendable