title: How do I add drag from right to left?
body: <p>Good afternoon, I have a menu layout that should be pushed to the left by clicking on a button in another View, it works!</p>
  <p>But, I need to add a Drag function to this Layout so that when Swiping from right to left, when it is open, the showMenu parameter is changed by the showMenu.toggle() method</p>
  <p>The full code and a screenshot of how it looks is presented below, thanks in advance for your help!</p>
  <p><a href="https://i.imgur.com/1Xp8FhG.png" rel="nofollow noreferrer">https://i.imgur.com/1Xp8FhG.png</a></p>
  <pre><code>import SwiftUI
  
  struct MenuView: View {
      @Binding var showMenu: Bool
      
      var body: some View {
          VStack {
              VStack {
                  HStack {
                      Image(&quot;DefaultAvatar&quot;)
                          .resizable()
                          .frame(maxWidth: 50,  maxHeight: 50)
                          .clipShape(Circle())
                      
                      VStack(alignment: .leading) {
                          Text(&quot;Name Name Name&quot;)
                              .font(.system(size: 20).bold())
                              .padding(.trailing, 40)
                          
                          Text(&quot;Parent&quot;)
                              .foregroundColor(.gray)
                              .font(.system(size: 12).bold())
                      }
                  }
                  .frame(maxWidth: .infinity, alignment: .leading)
                  .padding(.bottom, 50)
                  .padding(.leading, 20)
                  
                  HStack {
                      Image(systemName: &quot;person.fill&quot;)
                          .font(.system(size: 23).bold())
                          .foregroundColor(Color.white)
                          .frame(maxWidth: 45, maxHeight: 45)
                          .background(LinearGradient(gradient: Gradient(colors:
                                      [Color(red: 255/255, green: 119/255, blue: 46/255),
                                       Color(red: 255/255, green: 45/255, blue: 85/255)]),
                                                     startPoint: .topLeading,
                                                     endPoint: .bottomTrailing))
                          .mask(RoundedRectangle(cornerRadius: 14, style: .continuous))
                      
                      Text(&quot;Persons&quot;)
                  }
                  .frame(maxWidth: .infinity, alignment: .leading)
                  .padding(.leading, 20)
                  
                  Spacer()
                  Button {
                  } label: {
                      HStack {
                          Image(systemName: &quot;arrow.turn.down.left&quot;)
                          Text(&quot;Sign out&quot;)
                      }
                      .frame(maxWidth: .infinity, alignment: .leading)
                      .padding(.leading, 20)
                      .padding(.bottom, 50)
                  }
              }
              .padding(.top, 40)
              .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
              .background(Color.white)
              .mask(RoundedRectangle(cornerRadius: 30, style: .continuous))
              .padding(.trailing, 40)
              .shadow(color: Color.gray.opacity(0.3), radius: 10, x: 10, y: -10)
              .edgesIgnoringSafeArea(.bottom)
          }
      }
  }
  
  struct MenuView_Previews: PreviewProvider {
      static var previews: some View {
          MenuView(showMenu: .constant(false))
      }
  }
  
  </code></pre>