Generic Structure

Environment

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

Declaration

@frozen @propertyWrapper struct Environment<Value>

Topics

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.

Initializers

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.

Relationships

Conforms To

See Also

Environment Values

struct EnvironmentValues

A collection of environment values.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software