๐ฐview environment
โฑ๐ง under construction
SwiftUI โฉ view โฉ environment
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