State modifiers
Access storage and provide child views with configuration data.
Overview
SwiftUI provides tools for managing data in your app. For example, you can store values and objects in an environment that’s shared among the views in a view hierarchy. Any view that shares the environment — typically all the descendant views of the view that stores the item — can then access the stored item.
For more information about the types that SwiftUI provides to help manage data in your app, see Model data.
Topics
Identity
Environment values
Preferences
preference(key:value:)transformPreference(_:_:)anchorPreference(key:value:transform:)transformAnchorPreference(key:value:transform:)onPreferenceChange(_:perform:)backgroundPreferenceValue(_:_:)backgroundPreferenceValue(_:alignment:_:)overlayPreferenceValue(_:_:)overlayPreferenceValue(_:alignment:_:)