title: SwiftUI: Animate subview when map annotation is selected
body: <p>I have a MapView implementing UIViewRepresentable with the following coord function:</p>
  <pre><code>        func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
          let ann = view.annotation
          mapView.setCenter(CLLocationCoordinate2D(latitude: ann!.coordinate.latitude+0.01, longitude: ann!.coordinate.longitude), animated: true)
          withAnimation {
              self.parent.stateMap.annotationIsSelected = true
          }
      }
  </code></pre>
  <p>Note: stateMap is an EnvironmentObject</p>
  <p>I wish to animate a Subview triggered by the map annotation selection ie when stateMap.annotationIsSelected is set to true.</p>
  <pre><code>struct SubView: View {
      @EnvironmentObject var stateMap: StateMap
      var body: some View {
          if stateMap.annotationIsSelected {
              VStack(alignment: .leading) {
                  Text(&quot;\(stateMap.destination?.name ?? &quot;&quot;)&quot;).font(.headline)
              }.animation(.easeInOut, value: self.stateMap.annotationIsSelected)
          }
      }
  }
  </code></pre>
  <p>However the subview does not animate at all. What I am getting wrong?</p>