<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LocalAuthenticationEmbeddedUI",
  "identifier" : "/documentation/LocalAuthenticationEmbeddedUI/LAAuthenticationView",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Local Authentication Embedded UI"
    ],
    "preciseIdentifier" : "c:objc(cs)LAAuthenticationView"
  },
  "title" : "LAAuthenticationView"
}
-->

# LAAuthenticationView

A graphical representation of the state of biometric authentication.

```
class LAAuthenticationView
```

## Overview

In the view that you use to manage authentication, add a local authentication view
as a subview and provide it with an <doc://com.apple.documentation/documentation/LocalAuthentication/LAContext>
instance. For example, you can do this in the <doc://com.apple.documentation/documentation/AppKit/NSViewController/loadView()>
method of your view controller:

```swift
func loadView() {
    laContext = LAContext()
    laView = LAAuthenticationView(context: laContext)

    view.addSubview(laView)
    laView.translatesAutoresizingMaskIntoConstraints = false

    // Add more subviews and layout constraints...
}
```

When the view appears, call the context’s <doc://com.apple.documentation/documentation/LocalAuthentication/LAContext/evaluatePolicy(_:localizedReason:reply:)>
method to initiate the authentication:

```swift
override func viewDidAppear() {
    super.viewDidAppear()

    laContext.evaluatePolicy(
        .deviceOwnerAuthenticationWithBiometricsOrWatch,
        localizedReason: "access your data"
    ) { success, error in
        // Handle the result.
    }
}
```

The local authentication view displays an icon that depends on the type of authentication
you request, and the types of authentication that the system supports. For example,
for a device that supports Touch ID, if you request the <doc://com.apple.documentation/documentation/LocalAuthentication/LAPolicy/deviceOwnerAuthenticationWithBiometricsOrWatch>
policy, like in the example above, the view displays the familiar finger print icon:

![A screenshot of a circular icon with a pattern that resembles a finger print.](images/com.apple.Local-Authentication-Embedded-UI/laauthenticationview-1@2x.png)

In the case above, if the user has a connected Apple Watch, that authentication mechanism
works as well. If you limit the authentication to the <doc://com.apple.documentation/documentation/LocalAuthentication/LAPolicy/deviceOwnerAuthenticationWithWatch>
policy, the icon shows an Apple Watch in profile:

![A screenshot of a circular icon containing the profile of an Apple Watch.](images/com.apple.Local-Authentication-Embedded-UI/laauthenticationview-2@2x.png)

You can include other content around this icon that suits your app. The system also
displays a message on the Touch Bar or on the user’s Apple Watch, if appropriate.
When the evaluation succeeds, the icon transitions into a checkmark:

![A screenshot of a circular icon with a blue checkmark inside.](images/com.apple.Local-Authentication-Embedded-UI/laauthenticationview-3@2x.png)

If you call the evaluation without first attaching it to a local authentication view,
the system shows a standard authentication alert instead.

## Topics

### Creating a local authentication view

[`-  initWithContext:`](/documentation/LocalAuthenticationEmbeddedUI/LAAuthenticationView/init(context:))

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

[`context`](/documentation/LocalAuthenticationEmbeddedUI/LAAuthenticationView/context)

The local authentication context associated with the authentication view.

### Controlling the size of a local authentication view

[`-  initWithContext:controlSize:`](/documentation/LocalAuthenticationEmbeddedUI/LAAuthenticationView/init(context:controlSize:))

Creates a new authentication icon that reflects the current authentication state,
using a specified size.

[`controlSize`](/documentation/LocalAuthenticationEmbeddedUI/LAAuthenticationView/controlSize)

The size of the local authentication view user interface element.

## Relationships

### Conforms To

[`NSDraggingDestination`](/documentation/AppKit/NSDraggingDestination)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`NSAppearanceCustomization`](/documentation/AppKit/NSAppearanceCustomization)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSAnimatablePropertyContainer`](/documentation/AppKit/NSAnimatablePropertyContainer)

[`Equatable`](/documentation/Swift/Equatable)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`Hashable`](/documentation/Swift/Hashable)

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSView`](/documentation/AppKit/NSView)

---

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)