<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LocalAuthentication",
  "identifier" : "/documentation/LocalAuthentication/LocalAuthenticationView/init(_:context:)-7ejbu",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Local Authentication",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:28_LocalAuthentication_SwiftUI0aB4ViewV_7contextACy0cD04TextVG10Foundation23LocalizedStringResourceV_So9LAContextCtcAGRszrlufc"
  },
  "title" : "init(_:context:)"
}
-->

# init(_:context:)

Creates a new view and pairs it with the specified authentication context.

```
@MainActor @preconcurrency init(_ title: LocalizedStringResource, context: LAContext) where Label == Text
```

## Parameters

`title`

Title shown below the authentication view.

`context`

`LAContext`  instance to control the authentication.

## Discussion

The authentication is controlled using the provided authentication
context. When `evaluatePolicy` or `evaluateAccessControl` is called on this
context, the UI will be presented using this view rather than using the standard
authentication alert.

---

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)