Contents

focusedValue(_:_:)

Modifies this view by injecting a value that you provide for use by other views whose state depends on the focused view hierarchy.

Declaration

nonisolated func focusedValue<Value>(_ keyPath: WritableKeyPath<FocusedValues, Value?>, _ value: Value) -> some View

Parameters

  • keyPath:

    The key path to associate value with when adding it to the existing table of exported focus values.

  • value:

    The focus value to export.

Return Value

A modified representation of this view.

See Also

Exposing value types to focused views