title: How do you find out which view was tapped in SwiftUI?
body: <p>So if I make a tap gesture recogniser in SwiftUI, like this...</p>
  
  <pre><code>@State var tapped = false
  
  var tap: some Gesture {
      TapGesture(count: 1)
          .onEnded {
              _ in self.tapped = !self.tapped
              print("tapped!")
  
      }
  
  }
  </code></pre>
  
  <p>... and then add this tap gesture recogniser to programmatically created Views in a list, like so...</p>
  
  <pre><code> List {
                  // loop through all the posts and create a post view for each item
                  ForEach(posts) { post in
                      PostView(post: post)
                      .gesture(self.tap)
  
                  }
              }
  </code></pre>
  
  <p>... this works, the taps do register, but I can't figure out how to determine which view was tapped, so that I can use the tap to update a variable or call a function of the associated view.</p>