The SwiftUI Environment

Types as Keys πŸ”—

In SwiftUI, the environment allows setting and getting values where the keys are types conforming to a protocol and have default values. Here’s a sketch of what the implementation might look like: