---
title: "observeValue(forKeyPath:of:change:context:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/nshostingview/observevalue(forkeypath:of:change:context:)"
---

# observeValue(forKeyPath:of:change:context:)

## Declaration

```swift
@MainActor @preconcurrency override dynamic func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)
```
