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

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

Creates a local authentication view with a title text view.

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

## Parameters

`title`

A title that displays below the authentication view.

`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 <doc://com.apple.documentation/documentation/Swift/Result> instance that indicates success or failure with a reason.

---

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)