title: How to check EditButton/EditMode state in SwiftUI
body: <p>I have the following test codes. But when Edit button tapped Text doesn't change. I could not find anything about that. How to check/control editButton/editMode state changes?</p>
  <pre><code>struct TestView: View {
      @State private var list = [1,2,3,4,5]
      @State private var selection = Set&lt;Int&gt;()
      @Environment(\.editMode) var mode
      
      var body: some View {
          NavigationView {
              List(selection: $selection) {
                  ForEach(list, id: \.self) { item in
                      Text(&quot;\(item)&quot;)
                  }
              }
              .toolbar {
                  ToolbarItem(placement: .navigationBarLeading) {
                      EditButton()
                  }
                  ToolbarItem(placement: .navigationBarTrailing) {
                      if mode?.wrappedValue.isEditing ?? false {
                          Text(&quot;Editing&quot;)
                      } else {
                          Text(&quot;Not Editing&quot;)
                      }
                  }
              }
          }  
      }
  }
  </code></pre>