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

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

Creates a local authentication view with a title.

## Declaration

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

## 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.

## See Also

### Authenticating with an implicit context

- [init(reason:context:result:label:)](localauthentication/localauthenticationview/init(reason:context:result:label:).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)
