view environment
╱🚧 under construction
A view's environment provides access to the view's environment values.
A view inherits its environment from its container view:
subject to explicit changes from an
environment(_:_:)
view modifier,or by implicit changes from one of the many modifiers that operate on environment values.
As a result, you can configure a entire hierarchy of views by modifying the environment of the group’s container.
@StateObject:declare & init a state object
@Environment:read an environment value
view.environmentObject(_:):put an environment object
@EnvironmentObject:read an environment object
Last updated
Was this helpful?