             
         }
     }
+    
+    public override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
+        
+        switch self.state {
+            
+        case .changed:
+            
+            let time = event.timestamp - (lastMovement ?? 0)
+            
+            if time > 0.2 {
+                
+                self.velocity = .zero
+                
+            } else {
+                
+                self.velocity.x = displacement.x / CGFloat(movementDuration > 0 ? movementDuration : 0.001)
+                self.velocity.y = displacement.y / CGFloat(movementDuration > 0 ? movementDuration : 0.001)
+            }
+            
+            self.state = .ended
+            
+        default:
+            
+            self.state = .failed
+        }
+    }
 }

        
        translation = delta
        
        
        
        lastMovement = event.timestamp
        

        return translation
    }
    
    public func velocity(in view: UIView?) -> CGPoint {
        
        return velocity
    }
    
    // MARK: - Internal
    
    private var lastMovement: TimeInterval?
