Contents

init(reason:context:result:label:)

Creates a local authentication view.

Declaration

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

Parameters

  • reason:

    A localized reason that describes why your app presents an authentication prompt to the user.

  • context:

    A context used to evaluate authentication policies. If nil, the system creates one.

  • result:

    A closure to call when the authentication succeeds or fails.

    result

    A Result instance that indicates success or failure with a reason.

  • label:

    A label that displays below the authentication view.

See Also

Authenticating with an implicit context