title: Retrieve value from row in Swift List
body: <p>How can I get the value of the selected row in a list?</p>
  <p>For example:</p>
  <pre><code>var data: [String] = []    
  
  List {
     ForEach(0..&lt;data.count, id: \.self) { item in
       HStack {
          Text(data[item])
       }
     }
  } //: End of the List
  
  .onDelete(perform: { indexSet in
     // get the value of the row
     // get the corresponding key for the value
     // delete the value by the key from the dictionary
  }) //: End of the onDelete
  
  .onAppear {
     let dictionary = //retrieve the data from the database and get a dictionary
     for entry in dictionary {
        data.append(entry.value)
     }
  } //: End of the onAppear
  </code></pre>
  <p>How I can get the value of a selected row of the list?</p>