Contents

FocusedObject

A property wrapper type for an observable object supplied by the focused view or one of its ancestors.

Declaration

@MainActor @frozen @propertyWrapper @preconcurrency struct FocusedObject<ObjectType> where ObjectType : ObservableObject

Overview

Focused objects invalidate the current view whenever the observable object changes. If multiple views publish a focused object using the same key, the wrapped property will reflect the object that’s closest to the focused view.

Topics

Creating the focused object

Getting the value

See Also

Exposing reference types to focused views