---
title: "addObserver(_:)"
framework: Local Authentication
role: symbol
role_heading: Instance Method
platforms: [iOS 18.0+, iPadOS 18.0+, Mac Catalyst 18.0+, macOS 15.0+, visionOS 2.0+, watchOS 11.0+]
path: "localauthentication/laenvironment/addobserver(_:)"
---

# addObserver(_:)

## Declaration

```swift
func addObserver(_ observer: any LAEnvironment.Observer)
```

## Discussion

Discussion Adds observer to monitor changes of the environment. The observer will be held weakly so its instance should be kept alive by the caller.
