Generic Instance Method

overlayPreferenceValue(_:_:)

Returns a view that reads the value of preference Key from self, uses that to produce another view which is displayed as an overlay on self.

Declaration

func overlayPreferenceValue<Key, T>(_ key: Key.Type = Key.self, @ViewBuilder _ transform: @escaping (Key.Value) -> T) -> some View where Key : PreferenceKey, T : View

See Also

Responding to View Preferences

func onPreferenceChange<K>(K.Type, perform: (K.Value) -> Void) -> View

Adds an action to perform when the specified preference key’s value changes.

func backgroundPreferenceValue<Key, T>(Key.Type, (Key.Value) -> T) -> View

Returns a view that reads the value of preference Key from self, uses that to produce another view which is displayed as as the background to self.