Contents

init(_:reason:context:result:)

Creates a new LocalAuthenticationView.

Declaration

@MainActor @preconcurrency init(_ title: LocalizedStringResource, reason: Text, context: LAContext? = nil, result: @escaping (Result<Void, any Error>) -> Void) where Label == Text

Parameters

  • title:

    Title shown below the authentication view.

  • reason:

    Localized reason used for policy evaluation.

  • context:

    LAContext instance used for policy evaluation.

  • result:

    Result closure used for reporting the result of authentication.

Discussion

The view takes LAContext instance or creates own one if none provided and starts evaluating deviceOwnerAuthenticationWithBiometricsOrCompanion policy. The result of authentication is reported back using result closure.