---
title: "init(context:)"
framework: localauthenticationembeddedui
role: symbol
role_heading: Initializer
path: "localauthenticationembeddedui/laauthenticationview/init(context:)"
---

# init(context:)

Creates a new authentication icon that reflects the current authentication state.

## Declaration

```swift
init(context: LAContext)
```

## Parameters

- `context`: A local authentication context to associate with the icon.

## Discussion

Discussion Use this initializer to create a local authentication view and connect it to a particular local authentication context. You typically do this in the loadView() method of an NSViewController subclass. You then add this view as a subview — along with any text, imagery, and interactive elements that you need — to create a custom authentication interface. When your interface appears, call the LAContext instance’s evaluatePolicy(_:localizedReason:reply:) method to begin the authentication process.

## See Also

### Creating a local authentication view

- [context](localauthenticationembeddedui/laauthenticationview/context.md)
