Generic Structure


A dynamic view property that reads a value from the view’s environment.


@frozen @propertyWrapper struct Environment<Value>


Applying Color Schemes

enum ColorScheme

The possible types of color schemes, like Dark Mode.

enum ColorSchemeContrast

Possible values of the Increase Contrast user setting.

Supporting Accessibility Text Weights

Controlling Interaction

enum EditMode

The mode of a view indicating whether the user can edit its content.

Using Size Classes

enum UserInterfaceSizeClass

A set of values that indicate the visual size available to the view.

Handling Layout Direction

Supporting Types

protocol EnvironmentalModifier

A modifier that must resolve to a concrete modifier in an environment before use.


init(KeyPath<EnvironmentValues, Value>)

Creates an environment property to read the specified key path.

Instance Properties

Instance Methods

func update()

Updates the value of the property prior to populating the view.


Conforms To

See Also

Environment Values

struct EnvironmentValues

A collection of environment values.