<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LocalAuthentication",
  "identifier" : "/documentation/LocalAuthentication/LocalAuthenticationView/init(_:reason:context:result:)-88u6u",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Local Authentication",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:28_LocalAuthentication_SwiftUI0aB4ViewV_6reason7context6resultACy0cD04TextVG10Foundation23LocalizedStringResourceV_AISo9LAContextCSgys6ResultOyyts5Error_pGctcAIRszrlufc"
  },
  "title" : "init(_:reason:context:result:)"
}
-->

# init(_:reason:context:result:)

Creates a new `LocalAuthenticationView`.

```
@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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)