title: SwiftUI: How to Update NavigationView Detail Screens?
body: <p>I've got an app that gets a list of vehicles from a REST backend server. It then uses that list to build a list of vehicles that can be tapped to show the details about one of them:</p>
  
  <pre><code>@State private var selectedVehicle: Vehicle?
  @Binding var vehicles: [Vehicle]
  
  List {
    NavigationView {
  
      ForEach( vehicles ) { vehicle in
              NavigationLink( destination: VehicleDetailScreen( vehicle: vehicle ),
                              tag: vehicle,
                              selection: self.$selectedVehicle ) {
                                  Text( vehicle.name )
              }
      }
    }
  }
  
  struct VehicleDetailScreen: View {    
      var vehicle: Vehicle
  
      var body: some View {
         // Lots of rendering code omitted
      }
  
  }
  
  </code></pre>
  
  <p>So far, so good. This works nicely. The problem arises when we fetch updated information from the server. Updating the bound <code>vehicles</code> property works great for updating the list. But the detail screen is still showing data that's no longer relevant.</p>
  
  <p>My first thought was just to pop the detail view off of the NavigationView. Unfortunately, SwiftUI doesn't provide any reliable way that I can find to do this in a two-column view on the iPad.</p>
  
  <p>My next thought was that we needed to pass the vehicle in to VehicleDetailScreen as a @Binding too so that we can update it. But this is tough to do as well because we would need a reference to that binding so that we can cram updated values into it. The only way I can think of to do that would be to rework our network and model object code entirely so that it works like CoreData, keeping objects in memory and updating them with new values from the server, rather than generating new objects. This would be a good deal of effort, and obviously isn't something I'm keen to do if there's another option.</p>
  
  <p>So I'm kind of stuck on this. Any thoughts/ideas/suggestions are very welcome!</p>