title: How can I uncheck the radio button when the other is checked in my code using SwiftUI?
body: <p>How can I uncheck the radio button when the other is checked in my code using SwiftUI? I try it with onchange() but when I run it I should click two times to check the other box.</p>
  <pre><code> @State var onePrice = false
     @State var minMax = false
  HStack {
                
                  Toggle(isOn: $onePrice, label: {
                     
                  Text(&quot;One Price&quot;)
                      .fontWeight(.bold)
                      .font(.system(size: 18))
                  .foregroundColor(Color(&quot;grey&quot;))
                  .offset(x: -50, y: 1)
                  
              })
                  .onChange(of: onePrice, perform: { V in
                              minMax = false
                  })
                 
              .padding()
              .toggleStyle(CheckboxStyle())
              .offset(x: 1, y: -2)
              //.onTapGesture {
                //  self.minMax = false
             // }
                  
                
              Toggle(isOn: $minMax, label: {
                  Text(&quot;Min/Max&quot;)
                      .fontWeight(.bold)
                      .font(.system(size: 18))
                  .foregroundColor(Color(&quot;grey&quot;))
                      .offset(x: -40, y: 1)
               //  .foregroundColor(Color&quot;grey2&quot;)
                     
                      }
              )
              .onChange(of: minMax, perform: { V in
                        onePrice = false
             })
             
            
              .padding()
              .toggleStyle(CheckboxStyle())
              }.offset(x: -10, y: -90)
                  
  </code></pre>