title: SwiftUI List -> ForEach -> Item is a let, so i can't change a value
body: <p>I want to change the value of &quot;clicked&quot; if I tap on an item of the List (just toggle it) ...
  But this error comes: &quot;Cannot use mutating member on immutable value: 'item' is a 'let' constant&quot;
  I understand it right I think but I don't know how to fix that &quot;item&quot; ins't a let anymore
  Even when i create a mutating func in the struct to change the value doesn't work</p>
  <p>Thank you for helping!</p>
  <pre><code>struct Gamemode: Identifiable {
      var id: Int
      var name: String
      var clicked: Bool
  }
  
  struct ContentView: View {
      
      @State private var gamemodes: [Gamemode] = [
          Gamemode(id: 1, name: &quot;example text&quot;, clicked: false),
          Gamemode(id: 2, name: &quot;second example text&quot;, clicked: false),
          Gamemode(id: 3, name: &quot;third example text&quot;, clicked: false),
          Gamemode(id: 4, name: &quot;fourth example text&quot;, clicked: false)
      ]
      
      
      
      var body: some View {
          List {
              ForEach(gamemodes) { item in
                      VStack {
                          Text(&quot;Selection \(item.id)&quot;)
                          Text(&quot;\(item.name)&quot;)
                      }
                      .background(Color((item.clicked) ? .blue : .yellow))
                      .onTapGesture {
                          item.clicked.toggle()
                      }
              }
          }
      }
  }
  </code></pre>