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 == TextParameters
- title:
Title shown below the authentication view.
- reason:
Localized reason used for policy evaluation.
- context:
LAContextinstance 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.