title: Confusing about @EnvironmentObject in SwiftUI
body: <p>I'm trying practice <code>@EnvironmentObject</code> tool in SwiftUI.<br>
  the share object <code>User</code> init in <code>ContentView</code>.<br>
  When I switch from ContentView to NameView work very well.<br>
  But, from NameView to AgeView is failed. (take a look error message and Code session, please)</p>
  
  <p><strong>Error message</strong></p>
  
  <pre><code>Fatal error: No ObservableObject of type User found.
  </code></pre>
  
  <p>Could someone give me advice? Do I miss something? thx</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>init "User" type in contentView
  NavigationView
  
  +-----------+                   +--------+                   +-------+
  |ContentView+--NavigationLink--&gt;|NameView+--NavigationLink--&gt;|AgeView|
  +-----------+                   +--------+                   +-------+
  </code></pre>
  
  <pre><code>final class User: ObservableObject {
      @Published var name: String
      @Published var age: Int
  
      init(name: String, age: Int) {
          self.name = name
          self.age = age
      }
  }
  
  struct ContentView: View {
      var user: User = User(name: "SomeName", age: 44)
      var body: some View {
          NavigationView {
              VStack {
                  Text("name: \(self.user.name) age: \(self.user.age)")
                  NavigationLink(destination: NameView().environmentObject(self.user)) {
                      Text("Show Name")
                  }
              }
          }
      }
  }
  
  struct NameView: View {
      @EnvironmentObject var user: User
      var body: some View {
          VStack {
              Text("name: \(self.user.name)")
              NavigationLink(destination: AgeView()) {
                  Text("Show Age")
              }
          }
      }
  }
  
  struct AgeView: View {
      @EnvironmentObject var user: User
      var body: some View {
          VStack {
              Text("age: \(self.user.age)")
          }
      }
  }
  </code></pre>