<!--
{
  "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/FocusedBinding",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI14FocusedBindingV"
  },
  "title" : "FocusedBinding"
}
-->

# FocusedBinding

A convenience property wrapper for observing and automatically unwrapping
state bindings from the focused view or one of its ancestors.

```
@propertyWrapper struct FocusedBinding<Value>
```

## Overview

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

## Topics

### Creating the binding

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

A new property wrapper for the given key path.

### Getting the value

[`projectedValue`](/documentation/SwiftUI/FocusedBinding/projectedValue)

A binding to the optional value.

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

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

## Relationships

### Conforms To

[`DynamicProperty`](/documentation/SwiftUI/DynamicProperty)

---

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)