Generic Structure

EnvironmentObject

A dynamic view property that uses a bindable object supplied by an ancestor view to invalidate the current view whenever the bindable object changes.

Declaration

@frozen @propertyWrapper struct EnvironmentObject<ObjectType> where ObjectType : ObservableObject

Overview

You must set a model object on an ancestor view by calling its environmentObject(_:) method.

Topics

Initializers

Instance Methods

func update()

Updates the value of any dynamic variables prior to populating the view.

Relationships

Conforms To

See Also

Data-Dependent Views

struct State

A persistent value of a given type, through which a view reads and monitors the value.

Beta
protocol DynamicProperty

A stored variable that updates an external property of a view.

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