---
title: LAAuthenticationView
framework: localauthenticationembeddedui
role: symbol
role_heading: Class
path: localauthenticationembeddedui/laauthenticationview
---

# LAAuthenticationView

A graphical representation of the state of biometric authentication.

## Declaration

```swift
class LAAuthenticationView
```

## Overview

Overview In the view that you use to manage authentication, add a local authentication view as a subview and provide it with an LAContext instance. For example, you can do this in the loadView() method of your view controller: 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 evaluatePolicy(_:localizedReason:reply:) method to initiate the authentication: 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 deviceOwnerAuthenticationWithBiometricsOrWatch policy, like in the example above, the view displays the familiar finger print icon:

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 deviceOwnerAuthenticationWithWatch policy, the icon shows an Apple Watch in profile:

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:

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

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

### Controlling the size of a local authentication view

- [init(context:controlSize:)](localauthenticationembeddedui/laauthenticationview/init(context:controlsize:).md)
- [controlSize](localauthenticationembeddedui/laauthenticationview/controlsize.md)

## Relationships

### Inherits From

- [NSView](appkit/nsview.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSAnimatablePropertyContainer](appkit/nsanimatablepropertycontainer.md)
- [NSAppearanceCustomization](appkit/nsappearancecustomization.md)
- [NSCoding](foundation/nscoding.md)
- [NSDraggingDestination](appkit/nsdraggingdestination.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSStandardKeyBindingResponding](appkit/nsstandardkeybindingresponding.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)
- [NSUserInterfaceItemIdentification](appkit/nsuserinterfaceitemidentification.md)
