title: How to restrict dragging distance in SwiftUI
body: <p>I have an View which I want to be able to drag, but only by 25 points in every direction.</p>
  
  <p>Is this possible in SwiftUI ?</p>
  
  <p>Right now I have something like this:</p>
  
  <pre><code>.offset(x: viewState.width, y: viewState.height)
      .gesture(
          DragGesture()
             .onChanged { value in
                 self.viewState = ((value.translation.width &gt; -25 &amp;&amp; 
                                    value.translation.width &lt; 25) ||
                                    (value.translation.height &gt; -25 &amp;&amp;
                                    value.translation.height &lt; 25)) ?
                                    value.translation :
                                    CGSize.zero
                 }
             .onEnded { _ in
                self.viewState = CGSize.zero
             }
      )
  </code></pre>
  
  <p>But I am still able to drag it further than this if I drag slow.<br>
  Is it any way to drag it just a little bit and thats it ?</p>