title: how to swap two picker value when both of them are same in swiftUI
body: <p>in this code I want to change two picker values when they are same to remain this two different from each other. I try to use swap but that's not working properly.</p>
  <p>for example : when first picker value is one and second is two, when I try to change second value to &quot;one&quot;, value immediately change to one and first picker become two!</p>
  <pre><code> struct ContentView: View {
      @State private var list = [&quot;one&quot;,&quot;two&quot;,&quot;three&quot;,&quot;four&quot;,&quot;five&quot;]
      @State private var from: String = &quot;one&quot;
      @State private var from: String = &quot;two&quot;
           var body: some View {
         VStack {
            Picker(&quot;&quot;,selection: $from) {
               ForEach(list, id: \.self) { item in
                  Text(item)
           }
         }
         .pickerStyle(.menu)
         .padding(.trailing)
         .onChange(of: from) { newValue in
                                      if newValue == to {
                                          (to,from) = (from, to)
                                      }
                                  }  
  
            Picker(&quot;&quot;,selection: $to) {
               ForEach(list, id: \.self) { item in
                  Text(item)
           }
         }
         .pickerStyle(.menu)
         .padding(.trailing)
      }
      }
  }
  </code></pre>
  <p>I'm using this tuple solution for another section of the app but in this part that's not working :</p>
  <pre><code>(from, to) = (to, from) 
  </code></pre>
  <p>how can I perform immediately swap this two values when for example to going to the same with from?</p>