---
title: "environment(_:stateDidChangeFromOldState:)"
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/observer/environment(_:statedidchangefromoldstate:)"
---

# environment(_:stateDidChangeFromOldState:)

Called when there has been a change in the environment.

## Declaration

```swift
optional func environment(_ environment: LAEnvironment, stateDidChangeFromOldState oldState: LAEnvironment.State)
```

## Parameters

- `oldState`: The old environment state (before update)

## Discussion

Discussion Invoked on a queue private to LocalAuthentication framework. At the moment of invocation of this method, @c LAEnvironment.state already contains the new updated state.
