<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/FocusedValue",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI12FocusedValueV"
  },
  "title" : "FocusedValue"
}
-->

# FocusedValue

A property wrapper for observing values from the focused view or one of its
ancestors.

```
@propertyWrapper struct FocusedValue<Value>
```

## Overview

If multiple views publish values using the same key, the wrapped property
will reflect the value from the view closest to focus.

## Topics

### Creating the value

[`init(_:)`](/documentation/SwiftUI/FocusedValue/init(_:))

A new property wrapper for the given key path.

### Getting the value

[`wrappedValue`](/documentation/SwiftUI/FocusedValue/wrappedValue)

The value for the focus key given the current scope and state of the
focused view hierarchy.



---

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)