๐ธenvironment value
SwiftUI โฉ view โฉ environment โฉ value
A defined collection of values related to a view.
Some of these automatically reflect system state, user settings, or view state. Examples include the color scheme, text style, or focus state of the view.
Others provide useful default values, such as a line limit for text fields.
// read the color scheme (an environment value) of the current view
@Environment(\.colorScheme) var colorScheme: ColorScheme
Find many built-in environment values in
EnvironmentValues
.Create a custom
EnvironmentValues
property by:
dismiss๏ผAn action that dismisses the current presentation.
Last updated
Was this helpful?