Read in this post how to define custom keys in the SwiftUI environment and have values globally accessible throughout the view hierarchy.
Navigating Among SwiftUI Views
Meet a technique that lets you navigate and switch among SwiftUI views of the same hierarchy level when not using a navigation or tab view.