title: SwiftUI - How do I make edit rows in a list?
body: <p>I'd like to use the EditButton() to toggle edit mode, and have my list rows switch to edit mode. I want to include a new button in edit mode for opening a modal. I can't even get the EditMode value to switch the row content at all.</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct ContentView: View {
  
      @Environment(\.editMode) var isEditMode
  
      var sampleData = ["Hello", "This is a row", "So is this"]
  
      var body: some View {
          NavigationView {
  
              List(sampleData, id: \.self) { rowValue in
                  if (self.isEditMode?.value == .active) {
                      Text("now is edit mode")  // this is never displayed
                  } else  {
                      Text(rowValue)
                  }
              }
              .navigationBarTitle(Text("Edit A Table?"), displayMode: .inline)
              .navigationBarItems(trailing:
                  EditButton()
              )
          }
      }
  }
  </code></pre>