title: SwiftUI List rows with INFO button
body: <p>UIKit used to support TableView Cell that enabled a Blue info/disclosure button. The following was generated in SwiftUI, however getting the underlying functionality to work is proving a challenge for a beginner to SwiftUI.</p>
  <p><a href="https://i.stack.imgur.com/EeGSO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EeGSO.png" alt="Visually everything is fine as demonstrated below:" /></a></p>
  <p>Generated by the following code:</p>
  <pre><code>struct Session: Identifiable {
      let date: Date
      let dir: String
      let instrument: String
      let description: String
      var id: Date { date }
  }
  
  final class SessionsData: ObservableObject {
      @Published var sessions: [Session]
          
      init() {
          sessions = [Session(date: SessionsData.dateFromString(stringDate: &quot;2016-04-14T10:44:00+0000&quot;),dir:&quot;Rhubarb&quot;, instrument:&quot;LCproT&quot;, description: &quot;brief Description&quot;),
                      Session(date: SessionsData.dateFromString(stringDate: &quot;2017-04-14T10:44:00+0001&quot;),dir:&quot;Custard&quot;, instrument:&quot;LCproU&quot;, description: &quot;briefer Description&quot;),
                      Session(date: SessionsData.dateFromString(stringDate: &quot;2018-04-14T10:44:00+0002&quot;),dir:&quot;Jelly&quot;, instrument:&quot;LCproV&quot;, description: &quot; Description&quot;)
          ]
      }
      static func dateFromString(stringDate: String) -&gt; Date {
          let dateFormatter = DateFormatter()
          dateFormatter.locale = Locale(identifier: &quot;en_US_POSIX&quot;) // set locale to reliable US_POSIX
          dateFormatter.dateFormat = &quot;yyyy-MM-dd'T'HH:mm:ssZ&quot;
          return dateFormatter.date(from:stringDate)!
      }
  }
  
  struct SessionList: View {
      @EnvironmentObject private var sessionData: SessionsData
      
      var body: some View {
          NavigationView {
              List {
                  ForEach(sessionData.sessions) { session in
                      SessionRow(session: session )
                  }
              }
              .navigationTitle(&quot;Session data&quot;)
          }
          // without this style modification we get all sorts of UIKit warnings
          .navigationViewStyle(StackNavigationViewStyle())
      }
  }
  
  struct SessionRow: View {
      var session: Session
      
      @State private var presentDescription = false
      
      var body: some View {
          HStack(alignment: .center){
              VStack(alignment: .leading) {
                  Text(session.dir)
                      .font(.headline)
                      .truncationMode(.tail)
                      .frame(minWidth: 20)
  
                  Text(session.instrument)
                      .font(.caption)
                      .opacity(0.625)
                      .truncationMode(.middle)
              }
              Spacer()
              // SessionGraph is a place holder for the Graph data.
              NavigationLink(destination: SessionGraph()) {
                  // if this isn't an EmptyView then we get a disclosure indicator
                  EmptyView()
              }
              // Note: without setting the NavigationLink hidden
              // width to 0 the List width is split 50/50 between the
              // SessionRow and the NavigationLink. Making the NavigationLink
              // width 0 means that SessionRow gets all the space. Howeveer
              // NavigationLink still works
              .hidden().frame(width: 0)
  
              Button(action: { presentDescription = true
                  print(&quot;\(session.dir):\(presentDescription)&quot;)
              }) {
                  Image(systemName: &quot;info.circle&quot;)
              }
              .buttonStyle(BorderlessButtonStyle())
  
              NavigationLink(destination: SessionDescription(),
                             isActive: $presentDescription) {
                  EmptyView()
              }
              .hidden().frame(width: 0)
          }
          .padding(.vertical, 4)
      }
  }
  
  struct SessionGraph: View {
      var body: some View {
          Text(&quot;SessionGraph&quot;)
      }
  }
  
  struct SessionDescription: View {
      var body: some View {
          Text(&quot;SessionDescription&quot;)
      }
  }
  </code></pre>
  <p>The issue comes in the behaviour of the NavigationLinks for the SessionGraph. Selecting the SessionGraph, which is the main body of the row, propagates to the SessionDescription! hence Views start flying about in an un-controlled manor.</p>
  <p>I've seen several stated solutions to this issue, however none have worked using XCode 12.3 &amp; iOS 14.3</p>
  <p>Any ideas?</p>