SwiftUI Custom Environment Values

SwiftUI Custom Environment Values

Here’s my quick guide to creating your own custom SwiftUI environment values for things like global app settings.

SwiftUI makes frequent use of the environment to pass data values down the view hierarchy. The EnvironmentValues structure contains a long list of useful app settings that you can read using the Environment property wrapper:

[…]