---
title: "init(reason:context:result:label:)"
framework: localauthentication
role: symbol
role_heading: Initializer
path: "localauthentication/localauthenticationview/init(reason:context:result:label:)"
---

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

Creates a local authentication view.

## Declaration

```swift
@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.
- `label`: A label that displays below the authentication view.

## See Also

### Authenticating with an implicit context

- [init(_:reason:context:result:)](localauthentication/localauthenticationview/init(_:reason:context:result:)-8ubaq.md)
- [init(_:reason:context:result:)](localauthentication/localauthenticationview/init(_:reason:context:result:)-917ds.md)
- [init(_:reason:context:result:)](localauthentication/localauthenticationview/init(_:reason:context:result:)-4pkpi.md)
