Skip to content

Glossary: SwiftUI

@Environment

Also written: Environment, @Environment(\.dismiss), @Environment(\.modelContext)

A property wrapper that reads a value SwiftUI passes down the view tree, such as the shared OrderModel or the dismiss action. You name what you want with a type (`OrderModel.self`) or a key path (`\.dismiss`).

Where the book teaches it

Related terms

environmentdismisskey path